[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DataGrid Header

Posted on 2004-12-01
6
Medium Priority
?
544 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:Donnie4572
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:gdexter
ID: 12718151
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
 
LVL 4

Expert Comment

by:gdexter
ID: 12718194
Sorry should be

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

Author Comment

by:Donnie4572
ID: 12718715
Thanks for reply.
This didn't work. Should I edit the html?

<HeaderStyle CssClass="grid_header"></HeaderStyle>
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Author Comment

by:Donnie4572
ID: 12768254
Thanks for reply.
This didn't work. Should I edit the html?

<HeaderStyle CssClass="grid_header"></HeaderStyle>
0
 
LVL 4

Accepted Solution

by:
gdexter earned 2000 total points
ID: 12768433
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
 
LVL 12

Author Comment

by:Donnie4572
ID: 12768716
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question