Click to See Complete Forum and Search --> : DataGrid DoubleClick ?


dineshchirayil
October 9th, 2005, 07:20 AM
hi


i have some values like company deatils in DataGrid.
i want to select the company name and corresponding row by doubleclick or
a button out side the Grid contol.means how to select a entair row and Name (comapany Name) From Grid?

thanks in avance

nikko
October 10th, 2005, 10:49 AM
in the datagrid DoubleClick event, type this and see how it works


textbox1.Text = datagrid1.Item(datagrid1.CurrentCell.RowNumber, 0)
textbox2.Text = datagrid1.Item(datagrid1.CurrentCell.RowNumber, 1)


if you place two textboxes on your form, doubleclicking the datagrid will place the values of the first 2 columns into the textboxes.just increment the column number to refer to the other columns.

hope this is what u need...

happy coding!