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. Image for the cookie policy date
close icon

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.
Live Chat Icon For mobile
Up arrow icon