Color Hyperlink Column in Grid

3 posts, 1 answers
  1. Paul Liebrand
    Paul Liebrand avatar
    2 posts
    Member since:
    Jun 2007

    Posted 02 Apr 2013 Link to this post

    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. Answer
    Paul Liebrand
    Paul Liebrand avatar
    2 posts
    Member since:
    Jun 2007

    Posted 03 Apr 2013 Link to this post

    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;
        }
    }
  3. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 05 Apr 2013 Link to this post

    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.
Back to Top