Multi-selection datagrid rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

i'm using a dataview to filter my table.
how can i get a index (for the original table) of the selected rows (there
can be more than 1).

please help
 
If you want to have the DataRow of the DataTable, you can access it through
the DataRowView.Row property
 
DataTable myTable;
DataView myTableView

myTableView.Table=myTable
myTableView.RowFilter="...:"

DataRow myTableRow
foreach (DataRowView drv in myTableView)
{
myTableRow=(eventually cast to typed row)drv.Row;
....
}
 
first, thanks for applying...
second, what you are saying is good if i want to address ALL the rows that
match the filter. I want to address only the row(s) that are selected by the
user, from the filterd dataGrid...

thanks again
 
for (int i=0;i<myTableView.Count;i++)
{
if (DataGrid.IsSelected(i))
{
myTableRow=(..)myTableView.Row;
}
}
 
Back
Top