How to retrieve data from the selected row in datgrid. It is a single selection. So only one row will be selected
Printable View
How to retrieve data from the selected row in datgrid. It is a single selection. So only one row will be selected
Is this grid bound to a DataTable by chance?
Sorry for not replying sooner.
Well, I was using Visual Studio 2005, and then happened to use 2003 later. Thats where I got stuck....since CurrentCell is not available in it.
Anyway, I will not be using 2003 anymore, but it would be useful...to know how to retrieve a row's values using VS 2003.:) . That is without using CurrentCell.
If you're not using 2003 any more then it can't be useful to know, but maybe interesting. You use the CurrentRowIndex to get a DataRowView from the DefaultView of the bound DataTable, e.g.VB.NET Code:
Dim row As DataRowView = myDataTable.DefaultView(myGrid.CurrentRowIndex)