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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top