RowIndex and ColIndex

Hi,
I have a simple question regarding the QueryCellStyleInfo event in the grid control. I have the following code that randomly colors the background of each cell:

if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
{
String myValue = myColors[e.TableCellIdentity.RowIndex-1, e.TableCellIdentity.ColIndex-1].ToString();
Color c = Color.FromName(myValue);
e.Style.BackColor = c;
}

It colors all cells except the first row. The rowIndex when it drops into the 'if' loop is 2 so it does not color the very first row.

Note that myColors is an array with the colors that I want for each cell.

Thanks
David.


2 Replies

DA David A. Gonzales May 15, 2008 04:19 PM UTC

Never mind. I figured out my problem. It's working correctly after all. Sorry for that.

David



JA Janagan Syncfusion Team May 20, 2008 04:08 AM UTC

Hi David,

Thanks for the update. Please let me know if you have any other questions.

Thanks,
Janagan.


Loader.
Up arrow icon