C# – Not Changing Header Text Color In Gridview through using CSS

asp.netcgridview

I am using asp.net c#. I am using gridview to display the data. i am controlling all formating through CSS. In gridview i have define itemtemplate + edititemtemplate + footertemplate and doing sorting through bind column at template field. My problem is the column name which dispalay as header that color is not changed through CSS, font size,type all things going ok but fore color is fix as Blue is any body help me out how can i change forecolor of header which is allow to sorting.

My code looks like :
asp:TemplateField HeaderText="Slsmn No." HeaderStyle-CssClass="GridHeaderStyle" SortExpression="Profile_Var"

Problem is "Slsmn No." Display blue color and under line but in css i gave color:red

Thanks

Best Answer

The CSS class you've assigned (GridHeaderStyle) is being applied to the header cells, not the header links. It sounds like the default link color is being applied.

Add the following to your CSS file:

.GridHeaderStyle a {color: red;}

This should change the link color in the headers.

Hope this helps!