PDA

Click to See Complete Forum and Search --> : datagrid selected row values


sunshine123
May 8th, 2007, 02:31 AM
How to retrieve data from the selected row in datgrid. It is a single selection. So only one row will be selected

jmcilhinney
May 8th, 2007, 03:11 AM
Is this grid bound to a DataTable by chance?

sunshine123
May 9th, 2007, 08:46 AM
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.

jmcilhinney
May 9th, 2007, 09:46 AM
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.Dim row As DataRowView = myDataTable.DefaultView(myGrid.CurrentRowIndex)