[SOLVED] Datagridview: How to retrieve the selected row index and cell contents on a datagridview_Click event.

Answered
0
0

Hello:

I would like to retrieve the contents of a row from the datagridview when a row is clicked in order to present a pop detail form of the selected data row.

Is there a way I can do this ?

Thank you.

  • You must to post comments
Best Answer
0
0

Hi Bernard,

yes, there are several ways to achieve this. One is to handle the CellClick event
which carries the RowIndex in its EventArgs.
Then you could iterate through the columns of your DataGridview and concatenate them to a string.
Simple code sample:

dgvrow

Hope that answers your question.

Best regards
Frank

Attachment
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.