Hello,
get the selected rows by below code(they are copied in an arraylist),
Code:
public ArrayList GetSelectedRows(DataGrid dg)
{
ArrayList al = new ArrayList();
CurrencyManager cm = (CurrencyManager)this.BindingContext[dg.DataSource, dg.DataMember];
DataView dv = (DataView)cm.List;
for(int i = 0; i < dv.Count; ++i)
{
if(dg.IsSelected(i))
al.Add(i);
}
return al;
}
then set
RowFilter property of your DataView with the ID's in your arraylist,
Code:
string s="";
foreach(object o in GetSelectedRows(dataGrid1))
{
s+= "ID ="+o.ToString()+"OR";
}
//eliminate last "OR" from your string
dv.RowFilter=s;
//set the datasource of your grid with dv and bind ur grid
(this method just works in Windows Applications),
HtH.
_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.