datagridview row click

前端 未结 1 716
萌比男神i
萌比男神i 2021-01-05 01:46

I have a datagridview which is filled with data from db and i need to do this: when click on a row in datagrid all the fields with data from this row will be in other textbo

1条回答
  •  旧时难觅i
    2021-01-05 02:47

    On your CellClick event, do int rowIndex = e.RowIndex. From there you can do DataGridViewRow row = DataGridView1.Rows[rowIndex] and access all the cells in row (or better yet, from your underlying DataTable).

    0 讨论(0)
提交回复
热议问题