Hi,
I have a dataGridView and a webBrowser on a form. I have an Access database associated with the dataGridview. I have a list of URLs in one column and I want webbrowser to go to the URL when I click the cell that contains the URL on the dataGridView. Or I might have a button so that when I click on a cell and click the button, webbrowser will go to that URL. Is this possible?
Thanks in advance.

1 answers
yes it is, if you are talking about a grid view, try setting an event handler for cellselected so if the cell is a url cell the url is copied form the value of the selected cell to the webbrowser control.
answered one year ago by:
1556
108
So, I am trying something like: private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { webBrowser1.Navigate(new Uri(dataGridView1.SelectedCell.ToString())); } But it does not accept "SelectedCell", what should I write instead?
17279
Try: webBrowser1.Navigate(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
108
Well, I guess you have an answer to all my questions, the code you gave worked as I needed. Thanks again :)