Hello
I added columns to my WebDataGrid dynamically with C# and I want to set the background color of those columns.How can I do this please ?
Hi gtarek,
If you are creating the column dynamically, simply set the CssClass on the column itself to a class that has the background color defined that you desire.
BoundDataField col = new BoundDataField();
col.Key = "NewField";
col.CssClass = "red";
If the color is not getting applied, you may need to use selectors in the css class definition.
tbody > tr > td.red
Regards,David Young
Hi
I have to allow user to customize the columns background colors, he can define the colors that hi wants using hexadecimal color code. That is why the cssClass are not fixed.