Hyperlink Column in Windows RadGridView

8 posts, 0 answers
  1. Ganeshram
    Ganeshram avatar
    14 posts
    Member since:
    Feb 2008

    Posted 11 Feb 2008 Link to this post

    Hi,
    I have two questions

    Hyperlink Like Column:
        Basically I have to display a list of columns where some columns will be used as hyperlink to take it to their details.How to get a column as hyperlink in window gridview which will take it to new form.

    All I want to be able to add a column like the normal data grid view control where the user can click the text which appears like a hyperlink and have some action occur.
     
    Change the Font:
    I have a workaround solution if cannot create hyperlink like column.Change the color of the cellelement to Blue and underline.And on cell element click we can take it to new form.How to change the font of the cell element in runtime.I can see font.underline is readonly.?

    Please help

  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 11 Feb 2008 Link to this post

    Hi Ganeshram,

    Thank you for writing us.

    Currently, RadGridView does not support a hyperlink column. We will consider implementing this functionality in our upcoming Q1 2008 release.

    The following code demonstrates how to change the font and the color of a column to represent a hyperlink:

    Font font;  
    this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting);  
    this.radGridView1.CellClick += new GridViewCellEventHandler(radGridView1_CellClick);  
    this.radGridView1.DataSource = table;  
    this.radGridView1.Columns["Name"].ReadOnly = true;  
      
    void radGridView1_CellClick(object sender, GridViewCellEventArgs e)  
    {  
        if (e.ColumnIndex == 1 && e.RowIndex > 0)  
        {  
            Process.Start("http://www.google.com");  
        }  
    }  
      
      
    void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)  
    {  
        if (e.CellElement is GridDataCellElement)  
        {  
            if (((GridViewDataColumn)e.CellElement.ColumnInfo).DataField == "Name")  
            {  
                e.CellElement.Font = font;  
                e.CellElement.ForeColor = Color.Blue;  
            }  
        }  
    }  
      

    Do not hesitate to write us if you have other questions.

    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kumar
    Kumar avatar
    2 posts
    Member since:
    Mar 2010

    Posted 05 Mar 2010 Link to this post

    I do not see RadGridView supports hyperlink column yet. Is this being considered. Also as a work around I am trying to change the font to blue and underling the text. Is there a easy way to underline the text? Thanks in advance.
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 09 Mar 2010 Link to this post

    Hello Kumar,

    Yes, currently there is no dedicated hyper link column. You should use the code from my previous post. It changes the font color to blue by setting the ForeColor property. To make the font underlined just use the proper definition:

    Font font = new Font(SystemFonts.DialogFont, FontStyle.Underline);

    I hope this helps.

    All the best,

    Jack
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. RIZAL
    RIZAL avatar
    11 posts
    Member since:
    Jun 2015

    Posted 17 Sep 2015 Link to this post

    Hi, with the latest release, I think radgridview support to open other form beside goto to website.

    Can you show me how?

     

    Tq

  7. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 17 Sep 2015 Link to this post

    Hi,

    You can use the HyperlinkOpening event, which is cancelable and open the form that you want.

    More information regarding the hyperlink column is available here: http://www.telerik.com/help/winforms/gridview-columns-gridviewhyperlinkcolumn.html.

    I hope this helps.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. RIZAL
    RIZAL avatar
    11 posts
    Member since:
    Jun 2015

    Posted 17 Sep 2015 in reply to Stefan Link to this post

    Hi, sorry not to explain further.

     I tried using HyperlinkOpening and also HyperlinkOpened event but didn't worked.

    What I want to do is when user click the hyperlink, it will open the second form.

     The code:

    Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

          me.Textbox1.Text = ​Form1.​gridview.CurrentRow.Cells("ID").Value

    End Sub

     The problem is it shows the previous selected row index because the hyperlink row only will be selected after Form2 closed.

     

     

     

     

  9. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Sep 2015 Link to this post

    Hi,

    It seems you pasted wrong code snippet. Here is one demonstrating how this can be done:
    Private Sub RadGridView1_HyperlinkOpening(sender As Object, e As HyperlinkOpeningEventArgs)
        e.Cancel = True
     
        Dim f As New Form()
        f.Text = e.Column.Name + " " + e.Row.Index
        f.Show()
    End Sub

    I hope this helps.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready