Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removal of underline in a GridView TemplateField

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
0
0
US
Well, I have just about exhausted everything I can think of.

I have a gridview with a set of templatefields.

I want the header texst of the sortcolumns to NOT have the underline character. No matter what I do or what information I find in online forums, I can't get rid of them.

here's my code:
1. Style:

.specialAnchor a:link
{
text-align: center;
font-family: 'Verdana';
font-weight: bold;
font-size: 10pt;
font-style: normal;
color: black;
text-decoration: none;
vertical-align: Middle;
}

.specialAnchor a:hover
{
text-align: center;
font-family: 'Verdana';
font-weight: bold;
font-size: 10pt;
font-style: normal;
color: Blue;
text-decoration: underline;
vertical-align: Middle;
}

And here is the code for one of my sortcolumns in my GridView:
<asp:TemplateField ItemStyle-width = "50px" HeaderText = "ID" SortExpression="ID" HeaderStyle-CssClass="specialAnchor"><ItemTemplate><asp:Label ID="lblID" runat="server" Text='<%# Eval("ID")%>'></asp:Label></ItemTemplate></asp:TemplateField>

When this code is rendered, the header text ID is underlined. Plus, the color doesn't change to blue on hover, so it seems that the css is being disregarded. I do know that the css is relevant, because I can change the font-size to 12pt and the text becomes larger. Why doesn't the text color and decoration change accordingly???

Thanks in advance,

Jerry Scannell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top