Click to See Complete Forum and Search --> : DataGrid


arun.mpk
February 19th, 2009, 10:35 AM
Hi

Does any one know how to change the back ground color of individual column header in a datagrid. I know how to change the background color of all the column headers but not individuallly...

Example - I want my column 1 header to be displayed Red and Column 2 header to be displayed Green

Thanks in advance

Any idea??

JonnyPoet
February 19th, 2009, 02:28 PM
As the datagridview only has one property for setting the defaultHeaderCellStyle IMHO it will not be possible to get this done in a standard way.

Try if you can do it when using ownerdrawing the headers and look if there is a possibility so you will know which column is just painted.
If so you will be able to create your own datagridviw derived from the original one and there adding a property for a second color an ownerdrawing all that

arun.mpk
February 19th, 2009, 02:36 PM
many thanks for the reply jonny...