Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8052377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:31:50+00:00 2026-06-05T07:31:50+00:00

I have a datagridview with the following data. ContactType | Contact ———————————— Phone |

  • 0

I have a datagridview with the following data.

ContactType        |        Contact
------------------------------------
Phone              |       894356458
Email              |     xyz@abc.com

Here, I need to display the data “xyz@abc.com” as a hyperlink, with a tooltip “Click to send email”. The number data “894356458” should not have a hyperlink.

Any ideas???

TIA!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:31:52+00:00Added an answer on June 5, 2026 at 7:31 am

    The DataGridView has a column type for this, the DataGridViewLinkColumn.

    You need to databind this column type manually, where DataPropertyName sets the column to bind to in the grid’s datasource:

    DataGridViewLinkColumn col = new DataGridViewLinkColumn();
    col.DataPropertyName = "Contact";
    col.Name = "Contact";       
    dataGridView1.Columns.Add(col);
    

    You will also want to hide the autogenerated text column that comes from the Contact property of the grid.

    Also, as with the DataGridViewButtonColumn you need to handle the user interaction yourself by responding to the CellContentClick event.


    To then change cell values that are not hyperlinks to plain text you need to replace the link cell type with the textbox cell. In the example below I’ve done this during the DataBindingComplete event:

    void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
    {
        foreach (DataGridViewRow r in dataGridView1.Rows)
        {
            if (!System.Uri.IsWellFormedUriString(r.Cells["Contact"].Value.ToString(), UriKind.Absolute))
            {
                r.Cells["Contact"] = new DataGridViewTextBoxCell();
            }
        }
    }
    

    You can also do this from the other direction, changing the DataGridViewTextBoxCell to a DataGridViewLinkCell I suggest this second since you will need to apply any changes that apply to all links to every cell.

    This does have the advantage though that you will not then need to hide the autogenerated column, so may suit you best.

    void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
    {
        foreach (DataGridViewRow r in dataGridView1.Rows)
        {
            if (System.Uri.IsWellFormedUriString(r.Cells["Contact"].Value.ToString(), UriKind.Absolute))
            {
                r.Cells["Contact"] = new DataGridViewLinkCell();
                // Note that if I want a different link colour for example it must go here
                DataGridViewLinkCell c = r.Cells["Contact"] as DataGridViewLinkCell;
                c.LinkColor = Color.Green;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGridView set up with the following columns: Teacher, Subject, Date, Period.
I have a Dictionary bound to DataGridView by using following sample code. DataGridView bound
I have a DataTable which is bound to datagridview (Winforms)... I use the following
I have a datagridview and a combobox which get populated randomly with data. However,
I am using vb.net. I have a datagridview to show data. Since the datagridview
I have a datagridview (unbound). Fields are Name, Family Name and Phone No and
I have a DataGridView, which loads data from mdb Access table The grid only
I have an ADO.NET Entity Data Model and want to plumb up a DataGridView
I have a databound DataGridView. The data source is a typed data set with
Would someone kindly assist me with the following? I have two DataGridView objects that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.