Restricting rows via rowfilter?

B

Brett Romero

I have a CustomDataGrid that inherits DataGrid. I use the filter below
via a context menu, which works fine.

( ( DataTable ) this.DataSource ).DefaultView.RowFilter =
filterexpress;

The above gives me narrowed results via a right click on a grid cell.
I filter on the cell value. I'd like to click another cell and filter
again. For example, I start with 100 rows. I filter as above and get
50 rows. Now I want to filter on another cell on those 50 rows and get
25 rows or something less and keep restricting the view. However, each
successive filter starts with the original 100 rows. How do I keep
narrowing down the results?

Thanks,
Brett
 
M

Miha Markic [MVP C#]

Add expression with AND operator instead of overwritting current RowFilter.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You should keep in a variable the current filtering expression and add the
new one with an AND operand.
 

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

Top