Link to home
Start Free TrialLog in
Avatar of Donnie4572
Donnie4572Flag for United States of America

asked on

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
Avatar of gdexter
gdexter

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;
}
Sorry should be

a.grid_header:LINK
{
   color: #5e663a;
}
a.grid_header:HOVER
{
   color: #5e663a;
}
a.grid_header:ACTIVE
{
   color: #5e663a;
}
Avatar of Donnie4572

ASKER

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

<HeaderStyle CssClass="grid_header"></HeaderStyle>
Thanks for reply.
This didn't work. Should I edit the html?

<HeaderStyle CssClass="grid_header"></HeaderStyle>
ASKER CERTIFIED SOLUTION
Avatar of gdexter
gdexter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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;