tags:

views:

33

answers:

1

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 textboxes or something else. How to do so? Thanks in advance.

+1  A: 

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).

Dan Tao
thank you very much, it helped me a lot!