Skip to main content

How to: Filter Data by Multiple Columns

The following code applies a filter that selects cards where the country is USA and the quantity is less than 15. The filter criteria are displayed in the ASPxCardView’s title panel.

The image below shows the result:

ASPxCardView_Filtering_Code

        CardView.FilterExpression = "[Country] = 'USA' AND [Quantity] < 15";
        CardView.SettingsText.Title = CardView.FilterExpression;
        //...
        //An example on how to filter by dates
        DateTime date1 = new DateTime(1996, 12, 1);
        DateTime date2 = new DateTime(1996, 12, 31);
        string filter = String.Format("[OrderDate] > #{0}# And [OrderDate] < #{1}#",
        date1.ToShortDateString(), date2.ToShortDateString());
        CardView.FilterExpression = filter;