DataGrid Header

Hi,
I have datagrid in web app. I have the header text color set to green. When I enable sorting for the datagrid the text color changes to navy and ignores my settings. Should I set a color for "sortable header"?? If so, how? I'm using css stylesheet to control the color of the grids.

/* DataGrid header */
.grid_header{
     color: #5e663a;
     background-color: #b5b58e;
     border-color: Black;
     font-weight: bold;
     text-align: left;


Thanks,
Donnie
LVL 12
Donnie4572Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gdexterCommented:
Try this in your stylesheet
You should be able to override the anchor style

a.gridHeader:LINK
{
   color: #5e663a;
}
a.gridHeader:HOVER
{
   color: #5e663a;
}
a.gridHeader:ACTIVE
{
   color: #5e663a;
}
0
gdexterCommented:
Sorry should be

a.grid_header:LINK
{
   color: #5e663a;
}
a.grid_header:HOVER
{
   color: #5e663a;
}
a.grid_header:ACTIVE
{
   color: #5e663a;
}
0
Donnie4572Author Commented:
Thanks for reply.
This didn't work. Should I edit the html?

<HeaderStyle CssClass="grid_header"></HeaderStyle>
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Donnie4572Author Commented:
Thanks for reply.
This didn't work. Should I edit the html?

<HeaderStyle CssClass="grid_header"></HeaderStyle>
0
gdexterCommented:
Are you defining the 'a' styles below the 'grid_header' definition? This approach works for me.

/* DataGrid header */
.grid_header
{
     color: #5e663a;
     background-color: #b5b58e;
     border-color: Black;
     font-weight: bold;
     text-align: left;
}

a.grid_header:LINK
{
   color: #5e663a;
}
a.grid_header:HOVER
{
   color: #5e663a;
}
a.grid_header:ACTIVE
{
   color: #5e663a;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Donnie4572Author Commented:
I think I'm following you right. Please take a look at my stylesheet and html.
Thanks.

<asp:DataGrid id="dg" runat="server" Height="160px" AllowSorting="True" Width="98%" AutoGenerateColumns="False">
<FooterStyle CssClass="grid_header"></FooterStyle>
<SelectedItemStyle CssClass="grid_selitem"></SelectedItemStyle>
<AlternatingItemStyle CssClass="grid_altitem"></AlternatingItemStyle>
<ItemStyle CssClass="grid_item"></ItemStyle>
<HeaderStyle CssClass="grid_header"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"></asp:BoundColumn>
<asp:BoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name">
<HeaderStyle ForeColor="#5E663A"></HeaderStyle>
</asp:BoundColumn
<asp:BoundColumn DataField="ext" SortExpression="extnumb" HeaderText="Ext">
<HeaderStyle ForeColor="#5E663A"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Cell" SortExpression="Cell" HeaderText="Cell">
<HeaderStyle ForeColor="#5E663A"></HeaderStyle>
</asp:BoundColumn>
</Columns>
</asp:DataGrid></P>


.grid{
     font-size:10pt;
     color: #5e663a;
     background-color: White;
     CURSOR: crosshair;
}

/* DataGrid header */
.grid_header{
     color: #5e663a;
     background-color: #b5b58e;
     border-color: Black;
     font-weight: bold;
     text-align: left;
     color: #5e663a;
     }
a.grid_header:LINK
{
   color: #5e663a;
}
a.grid_header:HOVER
{
   color: #5e663a;
}
a.grid_header:ACTIVE
{
   color: #5e663a;
}

/* DataGrid items */
.grid_item{
     background-color: #ffffff;
     color: #5e663a;
     text-align: left;
     vertical-align: middle;
     CURSOR: crosshair;
     
}

/* DataGrid alternate items */
.grid_altitem{
     background-color: #f1efe2;
     color: #5e663a;
     TEXT-ALIGN: left;
     CURSOR: crosshair;  
}
     
/* DataGrid alternate items */
.grid_selitem{
     background-color: #5e663a;
     color: #5e663a;
     border-color: Black;
     vertical-align: middle;
     TEXT-ALIGN: center;
     font-weight: bold;
     CURSOR: crosshair;  

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.