FF,
Assuming it is bound to a data table, you can do this:
// Get the data source.
DataView dv = ((DataTable) dataGrid.DataSource).DefaultView;
// Get the row.
DataRowView rv = dv[dataGrid.CurrentRowIndex];
Of course you might want to check for the cases where there are no
records. This returns a data row view, which is the row of data, possibly
filtered based on row state.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
FF said:
Hi all,
I want to know how I can retrive the selected row in a DataGrid control
(Not the row index)!
Thanks
FF