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.
Unfortunately, activation email could not send to your email. Please try again.

RowIndex and ColIndex

Thread ID:

Created:

Updated:

Platform:

Replies:

73720 May 15,2008 11:25 AM May 20,2008 12:08 AM ASP.NET Web Forms (Classic) 2
loading
Tags: GridGroupingControl
David A. Gonzales
Asked On May 15, 2008 11:25 AM

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.


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

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

David


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

Hi David,

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

Thanks,
Janagan.


CONFIRMATION

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.

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.

;