We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

RowIndex and ColIndex

Thread ID:





73720 May 15,2008 03:25 PM UTC May 20,2008 04:08 AM UTC ASP.NET Web Forms (Classic) 2
Tags: GridGroupingControl
David A. Gonzales
Asked On May 15, 2008 03:25 PM UTC

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.


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

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


Janagan [Syncfusion]
Replied On May 20, 2008 04:08 AM UTC

Hi David,

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



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon