remove underline

2 posts, 0 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 15 Jun 2012 Link to this post

    How to set css to remove underline in a gridhyperlinkcolumn
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Jun 2012 Link to this post

    Hi Tina,

    Try the following code snippet to achieve your scenario.

    CSS:
    <style type="text/css">
      .class
       {
         text-decoration:none;
       }
    </style>

    C#:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
      if (e.Item is GridDataItem)
      {
        GridDataItem item = (GridDataItem)e.Item;
        HyperLink link = (HyperLink)item["UniqueName"].Controls[0];
        link.CssClass = "class";
      }
    }

    Hope this helps.

    Thanks,
    Princy.
Back to Top