Link to home
Start Free TrialLog in
Avatar of mcs26
mcs26

asked on

C# 4.0 WPF Datagrid Filtering

Hi,

I have an object (please see code below) which contains a list. This list is currently binded to a datagrid in my WPF application.

What I would like to do is to be able to display only some of the results from my list based on the field Status. Can someone please send me some example code of how to do this?

C# Code
class OrderBlocks
{
   public string setting;
   public List<Order> Orders;
}

class Order
{
  public double Amount;
  public int Name;
  public bool Status;
}

Open in new window


XAML

<DataGrid DataContext="{Binding OrderBlock}"
                      Name="dataGridOrders" 
                      ItemsSource="{Binding Orders}"/>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aaron Jabamani
Aaron Jabamani
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial