Groups | Blog | Home
all groups > asp.net datagrid control > january 2007 >

asp.net datagrid control : Changing color of a column in a datagrid.


UJ
1/26/2007 7:46:55 AM
How can you change the background color for a single column in a datagrid. I
can figure out how to do it for the entire row (e.item.backcolor = ....) but
how do I do it for a single column?

TIA - Jeff.

Alexey Smirnov
1/26/2007 2:32:39 PM
I would use the property builder of the data grid
<HeaderStyle BackColor="Green"></HeaderStyle>
<ItemStyle BackColor="Green"></ItemStyle>
<FooterStyle BackColor="Green"></FooterStyle>




[quoted text, click to view]

Eliyahu Goldin
1/27/2007 9:04:49 PM
e.Item.Cells[i].BackColor = ... for every item.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


[quoted text, click to view]

AddThis Social Bookmark Button