Randy,
Once you have your datagrid row, you can select against your source table.
But you will need to have a unique-valued column.
for example, if you have an "ID" column;
DataTable tblSource = datagrid.source as DataTable;
DataRow[] rowSelected = tblSource.Select("ID" + dataGrid[e.Row,
nIDColumn].ToString());//Where nIDColumn is the column that holds unique
values
When using a Datable.Select(), it is possible that more than one row meets
the Select criteria. But if your column has unique values, then the result
you want is always at index 0. So in this case rowSelected[0] would be your
only result.
hope this helps,
regards,
Marco
"Randy" <rb***@sumaria.net> wrote in message
news:0D***************@nwrdny03.gnilink.net...
I have a DataTable in a DataGrid.
If I click on the DataGrid, HitTestInfo in dataGrid1_MouseDown returns a
Row and Column number. I can use the Row number to say:
DataRow dr = dataTable.Rows[Row];
Of course, I get completely the wrong row of data if the user has sorted
the table by clicking any of the column headers.
Any thoughts on how to get the clicked-on dataTable row, regardless of
whether or not the column headers are being used to sort?
Thanks,
Randy