Change DataGrid Headings color

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

How do I change the color of a particular columns' text (forecolor)?

I normally do this in my PreRender function for the rows as:

for each oItem as DataGridItem in DataGrid1.Items
oLabel = CType(oItem.FindControl("SessionID"),Label)
oLabel.ForeColor = System.Drawing.Color.Orange
next

How do I access the columns HeaderText to make this change?

Thanks,

Tom
 
Winista said:
You can do it in RowCreated or DataBound events for the grid.
The articles in this link will give you some more info about it.

http://www.netomatix.com/datagridseries.aspx

Good articles, but none of them (at least as far as I could tell) talk about
how to change a particular columns HeaderText.

One of the articles talk about how to change the headers as a group, but not
a particular header, as we can do with a particular cell.

Thanks,

Tom
 
Back
Top