Hi all
I am currently using a Bound Read Only data grid.
What I am looking to do is have different colour rows depending on the data
in the row.
EG. If the status = Closed then that row should be Red, If the Status = Open
then That row should be Green.
I am trying not to loop through all the rows setting the Back colour of each
row or I may as well not bother binding the grid.
Any ideas?
Thanks.
ink 4 2947
If this is a DataGridView, then you could try handling the RowPrePaint
event and there conditionally set the BackColor.
void dataGridView1_RowPrePaint(object sender,
DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex == 1)
dataGridView1.Rows[1].DefaultCellStyle.BackColor =
Color.Red;
else if(e.RowIndex == 3)
dataGridView1.Rows[3].DefaultCellStyle.BackColor =
Color.Blue;
}
==================
Clay Burch
Syncfusion, Inc.
Thanks for the advice Clay.
i will give this a try.
"ClayB" <cl***@syncfusion.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
If this is a DataGridView, then you could try handling the RowPrePaint
event and there conditionally set the BackColor.
void dataGridView1_RowPrePaint(object sender,
DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex == 1)
dataGridView1.Rows[1].DefaultCellStyle.BackColor =
Color.Red;
else if(e.RowIndex == 3)
dataGridView1.Rows[3].DefaultCellStyle.BackColor =
Color.Blue;
}
==================
Clay Burch
Syncfusion, Inc.
THis document has a lot of anwers to questions liek yours: http://www.windowsforms.net/Samples/...View%20FAQ.doc
It is GREAT!
"iKiLL" wrote:
Thanks for the advice Clay.
i will give this a try.
"ClayB" <cl***@syncfusion.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
If this is a DataGridView, then you could try handling the RowPrePaint
event and there conditionally set the BackColor.
void dataGridView1_RowPrePaint(object sender,
DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex == 1)
dataGridView1.Rows[1].DefaultCellStyle.BackColor =
Color.Red;
else if(e.RowIndex == 3)
dataGridView1.Rows[3].DefaultCellStyle.BackColor =
Color.Blue;
}
==================
Clay Burch
Syncfusion, Inc.
Thanks Chris
i will take a look
"Chris" <Ch***@discussions.microsoft.comwrote in message
news:E7**********************************@microsof t.com...
THis document has a lot of anwers to questions liek yours:
http://www.windowsforms.net/Samples/...View%20FAQ.doc
It is GREAT!
"iKiLL" wrote:
>Thanks for the advice Clay.
i will give this a try.
"ClayB" <cl***@syncfusion.comwrote in message news:11*********************@l77g2000hsb.googlegr oups.com...
If this is a DataGridView, then you could try handling the RowPrePaint
event and there conditionally set the BackColor.
void dataGridView1_RowPrePaint(object sender,
DataGridViewRowPrePaintEventArgs e)
{
if (e.RowIndex == 1)
dataGridView1.Rows[1].DefaultCellStyle.BackColor =
Color.Red;
else if(e.RowIndex == 3)
dataGridView1.Rows[3].DefaultCellStyle.BackColor =
Color.Blue;
}
==================
Clay Burch
Syncfusion, Inc.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: arifvahora |
last post by:
Active Server Pages error 'ASP 0240'
Script Engine Exception
work.asp
A ScriptEngine threw exception 'C0000005' in
'IActiveScript::SetScriptState()' from...
|
by: Daric |
last post by:
Hi, al
I'm using VS2002 to create my web application, by default, VS2002 will build my project in a single dll (myWebApp.dll), but I hope each page correspond to it's own dll (page1.dll, page2.dll),...
|
by: |
last post by:
I have not been able to see any difference between what happens when I use
Build>Build Solution or Build>ReBuild Solution.
Is there any reason to use one or the other at any time?
Thanx......joisey
|
by: Pavel A. |
last post by:
Can anybody shed some light... Confused here :((
Isn't VS.2005 supposed to use the new build system, that can be invoked
separately from the IDE?
If yes, why it creates vcproj files? Are these...
|
by: Larry Hastings |
last post by:
I'm an indie shareware Windows game developer. In indie shareware
game development, download size is terribly important; conventional
wisdom holds that--even today--your download should be 5MB or...
|
by: Mike |
last post by:
Hi,
I'm a complete newbie to XML and am needing to rush through a job requiring
far more knowledge than I have the time to gather.
Basically... I need to build a breadcrumb menu for our...
|
by: michael.lang |
last post by:
I am using PostBuild events in a C# project to run some tasks, but only
when in release configuration mode. The build events run perfectly as
expected when run. The problem comes when I save the...
|
by: maggie.nguyen |
last post by:
Hi,
I use Visual Studios 2005.
In my project file, I include the library in linker:
"Additional Library Directories: ..\..\boost\lib"
I have these libs in the boost\lib directory:
...
|
by: anupamak |
last post by:
hello,
I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE,...
|
by: yxq |
last post by:
Hello,
I want to build the multi-language application with the xml file, how to do?
could anyone tell a sample?
Thank you
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |