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

Color Hyperlink Column in Grid

2 Answers 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul Liebrand
Top achievements
Rank 1
Paul Liebrand asked on 02 Apr 2013, 07:14 PM
All,

What is the best way to color a hyperlink column in the RadGridView during runtime?  For example, I want to change the default color, the visited color, mouse over, etc.

Thanks,

Paul

2 Answers, 1 is accepted

Sort by
0
Accepted
Paul Liebrand
Top achievements
Rank 1
answered on 03 Apr 2013, 10:24 PM
For those looking to do the same thing, you need to do it via the ContentElement. For example:

void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    GridHyperlinkCellElement cell = e.CellElement as GridHyperlinkCellElement;
    if (cell!=null)
    {
       cell.ContentElement.ForeColor = Color.Blue;
    }
}
0
Stefan
Telerik team
answered on 05 Apr 2013, 07:23 AM
Hi Paul,

I can confirm that this is the CellFormatting event is the correct way to introduce such changes to a hyperlink cell. We will consider adding an example in our documentation in future.

All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
GridView
Asked by
Paul Liebrand
Top achievements
Rank 1
Answers by
Paul Liebrand
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or