Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello

i have one question



i have one datagrid and the content of that datagrid are name ,address,phone email and url. the value of tht datagrid are as follows:
name address phone email url
xyz india 123456789 test@test.com https://www.google.com



now my question is when i click on url(https://www.google.com) how to fetch that url from datagrid to mozilla or IE


plz help me out
Posted

Do like this, and if it is a valid url, then the value inside the cell will open up in your default browser. System.Diagnostics.Process.Start can start any program or open a file, so if you write the full path of an executable file, you can start that also.

C#
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {   
        if(e.ColumnIndex == 4) //According to your question
           {
             System.Diagnostics.Process.Start(dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString());
           }
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900