Applying CSS for gridview template column


H

Harsha

I am trying to apply predefined css class for gridview, Like

<asp:TemplateColumn HeaderText="Name">
<ItemTemplate>
<asp:HyperLink ID="hlFN1" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Name") %>'
CssClass="GridviewHyperlink" Target="_parent" NavigateUrl='<%#
DataBinder.Eval(Container, "DataItem.FileName") %>'>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>

My class "GridviewHyperlink" is black color text without underline.

But when page gets rendered Column "Name" will come with blue
underlined text.

Any help please..

Regards
Sriharsha Karagodu
 
Ad

Advertisements

S

Stan

I am trying to apply predefined css class for gridview, Like

<asp:TemplateColumn HeaderText="Name">
        <ItemTemplate>
                <asp:HyperLink ID="hlFN1" runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Name") %>'
CssClass="GridviewHyperlink" Target="_parent"  NavigateUrl='<%#
DataBinder.Eval(Container, "DataItem.FileName") %>'>
                </asp:HyperLink>
        </ItemTemplate>
</asp:TemplateColumn>

My class "GridviewHyperlink" is black color text without underline.

But when page gets rendered Column "Name" will come with blue
underlined text.

Any help please..

Regards
Sriharsha Karagodu

Hi

Try these settings in the CSS file:

.GridviewHyperlink a:link
{
text-decoration: none;
color: black;
}

BTW make sure that the case in your attribute value is identical to
that in the CSS file entry.
 

Top