change backcolor


Hi,

I'm trying to change the backcolor of the columns that are frozen. Is there an easy way to read out a collection of frozen columns?

I'm also thinking about changing the backcolor of the header of the frozen columns. Is there an easy way to accomplish this? Thanks!

1 Reply

HA haneefm Syncfusion Team July 9, 2007 06:08 PM UTC

Hi Code12345,

You can handle the PrepareViewStyleInfo event to set the backcolor of the cell in a grid. Below is a code snippet

private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
GridDataBoundGrid _grid = sender as GridDataBoundGrid;
if( e.ColIndex > 0 && e.ColIndex <= _grid.Model.Cols.FrozenCount)
{
e.Style.Themed = false;
e.Style.BackColor = Color.Red;
}
}

Best regards,
Haneef

Loader.
Up arrow icon