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

Hyperlink forecolor

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 17 Sep 2012, 11:57 AM
Hi,
     I have a gridhyperlink column in my radgrid. I want to change the forecolor of the link. How do I make the change. Please help me out.
thanks in advance
Savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Sep 2012, 12:01 PM
Hi Savyo,

Please try this code snippet to give color for GridHyperLinkColumn.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
   if (e.Item is GridDataItem)
   {
      GridDataItem item = (GridDataItem)e.Item;
      HyperLink hyplnk = (HyperLink)item["UniqueName"].Controls[0];
      hyplnk.ForeColor = System.Drawing.Color.Blue;
   }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or