Donnie4572
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
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
Sorry should be
a.grid_header:LINK
{
color: #5e663a;
}
a.grid_header:HOVER
{
color: #5e663a;
}
a.grid_header:ACTIVE
{
color: #5e663a;
}
a.grid_header:LINK
{
color: #5e663a;
}
a.grid_header:HOVER
{
color: #5e663a;
}
a.grid_header:ACTIVE
{
color: #5e663a;
}
ASKER
Thanks for reply.
This didn't work. Should I edit the html?
<HeaderStyle CssClass="grid_header"></H eaderStyle >
This didn't work. Should I edit the html?
<HeaderStyle CssClass="grid_header"></H
ASKER
Thanks for reply.
This didn't work. Should I edit the html?
<HeaderStyle CssClass="grid_header"></H eaderStyle >
This didn't work. Should I edit the html?
<HeaderStyle CssClass="grid_header"></H
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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"></F ooterStyle >
<SelectedItemStyle CssClass="grid_selitem"></ SelectedIt emStyle>
<AlternatingItemStyle CssClass="grid_altitem"></ Alternatin gItemStyle >
<ItemStyle CssClass="grid_item"></Ite mStyle>
<HeaderStyle CssClass="grid_header"></H eaderStyle >
<Columns>
<asp:BoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"></asp:BoundColumn>
<asp:BoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name">
<HeaderStyle ForeColor="#5E663A"></Head erStyle>
</asp:BoundColumn
<asp:BoundColumn DataField="ext" SortExpression="extnumb" HeaderText="Ext">
<HeaderStyle ForeColor="#5E663A"></Head erStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Cell" SortExpression="Cell" HeaderText="Cell">
<HeaderStyle ForeColor="#5E663A"></Head erStyle>
</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;
Thanks.
<asp:DataGrid id="dg" runat="server" Height="160px" AllowSorting="True" Width="98%" AutoGenerateColumns="False
<FooterStyle CssClass="grid_header"></F
<SelectedItemStyle CssClass="grid_selitem"></
<AlternatingItemStyle CssClass="grid_altitem"></
<ItemStyle CssClass="grid_item"></Ite
<HeaderStyle CssClass="grid_header"></H
<Columns>
<asp:BoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"></asp:BoundColumn>
<asp:BoundColumn DataField="FirstName" SortExpression="FirstName"
<HeaderStyle ForeColor="#5E663A"></Head
</asp:BoundColumn
<asp:BoundColumn DataField="ext" SortExpression="extnumb" HeaderText="Ext">
<HeaderStyle ForeColor="#5E663A"></Head
</asp:BoundColumn>
<asp:BoundColumn DataField="Cell" SortExpression="Cell" HeaderText="Cell">
<HeaderStyle ForeColor="#5E663A"></Head
</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;
You should be able to override the anchor style
a.gridHeader:LINK
{
color: #5e663a;
}
a.gridHeader:HOVER
{
color: #5e663a;
}
a.gridHeader:ACTIVE
{
color: #5e663a;
}