how can i change a particular cell color in GridGroupingControl.

Hi

I tried using this peice of code for changing a particular cell color 1st row 4th column. But it doesnt work.
It behaves like read only.

this.gridGroupingDataView.TableControl.Model[1, 4].TextColor = Color.Red;

CAn u plz help me out.

1 Reply

JJ Jisha Joy Syncfusion Team May 20, 2010 11:54 AM UTC

Hi Neha,

In GridGroupingControl you need to handle QueryCellStyleInfo event to set cell styles. Here you could check for indexes and set the styles.

this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);


void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.RowIndex == 4 && e.TableCellIdentity.ColIndex == 2)
{
e.Style.TextColor = Color.PaleGreen;
}
}

Regards,
Jisha

Loader.
Up arrow icon