I need to know how to get all of the values out of a selected row in a datagrid? VB.net example would be great! I would like to loop through each cell in a selected row, grab each value and its corresponding column name, and store both values. Here
is what I have so far... I'm not sure how to access each cell's content.
dg As DataGrid
Dim intCounter, intRowIndex, intNumColumns
'Retrieves the selected row's Index which is zero based.
dg = dgResults
intRowIndex = dg.SelectedIndex
intNumColumns = dgResults.Columns.Count
"The Row's Number:" &
" " & Convert.ToString(intRowIndex) &
" " &
"The # of Columns" &
" " & Convert.ToString(intNumColumns))
While intCounter <= intNumColumns
intCounter += 1