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"];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top