How can I colour a whole column except headers?

Hi

Can anyone help me in working out how to colour a whole column (with the exception of the header which I want kept a different colour) so as I add more rows they will automatically get added with the columns colour?

I've used the cell.backcolor to colour the cells as I fill them with data, but when I add rows to different columns I then get left with 'white' background on the new rows on other columns. Potentially each column in the grid could be a different colour background.

Thanks in advance,

David

2 Replies

AD Administrator Syncfusion Team October 26, 2006 10:19 AM UTC

Hi David,

Use the Model.ColStyles property of the GridModel to manage the appearance of the column in a grid. Below is a code snippet

this.grid.Model.ColStyles[1].BackColor = Color.Green;

Best Regards,
Haneef


DH David Hook October 26, 2006 10:49 AM UTC

Thanks Haneef

Perfect!

David

Loader.
Up arrow icon