This is a migrated thread and some comments may be shown as answers.

GridHyperLinkColumn and underline

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 11 Oct 2010, 11:25 PM
I am using the Office2007 skin. Is there an easy way to override the style so that the underline on the hyperlink is not displayed?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 12 Oct 2010, 06:37 AM
Hello Darren,

Check out the following code snippet which shows how to remove underline from HyperLinkColumn.

ASPX:
<telerik:GridHyperLinkColumn DataTextField="CompanyName" DataNavigateUrlFields="CompanyName" UniqueName="GridHyperLinkColumn" ></telerik:GridHyperLinkColumn>

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

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

Thanks,
Princy.
Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or