Filtering Datagrid's Rows

  • Thread starter Thread starter Stefan Rose
  • Start date Start date
S

Stefan Rose

Hallo

I bound a datagrid object to a datatable inside a dataset(using DataSouce
and DataMember properaties and not by refrencing the datatable directly) .
But when I use the following

myDataSet.Tables["myTable"].DefaultView.RowFilter = "ID = 4" ;

it doesn't affect the displayed datagrid. How can I filter the rows in my
datagrid ?

thanks
 
Hi Stefan,

You might create a DataView on that table and bind your grid to it, or bind
to table directly.
dataGrid.DataSource = myDataSet.Tables["myTable"];
 
Back
Top