# Filter Summaries

This topic covers how to configure the Checklist filter to implement the filter summaries.

## Content



DataFilter control allows you to configure the Checklist filter to implement the filter summaries using **AggregateType** property of the <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/api/wpf/online-datafilter/dotnet-api/C1.WPF.DataFilter/C1.WPF.DataFilter.FilterSummary.html\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/api/wpf/online-datafilter/dotnet-framework-api/C1.WPF.DataFilter.4.6.2/C1.DataFilter.FilterSummary.html\u0022\u003e.NET Framework\u003c/a\u003e versions." data-popup-title="FilterSummary" data-popup-theme="ui-tooltip-green qtip-green">FilterSummary</span> class and by assigning **AggregateType** Enum. The feature makes it easier for you to analyze the count, sum, maximum and minimum values of the filter items.

Let us take a use case to display count and maximum values of the filter items in a checklist filter. In the image and example below, _count_ of the individual filter items of the _Brand_ filter are listed and _maximum_ price values for the filter items in the _Category_ filter are listed.

![The image depicts an application showing the Datafilter showing filter summaries.](https://cdn.mescius.io/document-site-files/images/0bed9dd6-7ca6-4e9d-a89e-443ea1c855b0/images/filtersummary.png)

You can use the following code to display the count of the filter items and the maximum value of a filter item corresponding to the data.

**vbnet**

```vbnet
Private Sub C1DataFilter_FilterAutoGenerating(sender As Object, e As C1.DataFilter.FilterAutoGeneratingEventArgs)
    Select Case e.[Property].Name
        Case "Name"
            Dim brandFilter = CType(e.Filter, C1.WPF.DataFilter.ChecklistFilter)
            brandFilter.ItemsSource = _products
            brandFilter.ValueMemberPath = "Name"
            'Define the summary for the Checklist filter defined for Brand Field.
            'This summary displays the count of cars available for each brand.
            brandFilter.FilterSummary.AggregateType = AggregateType.Count
            brandFilter.FilterSummary.Label = "Count"
            brandFilter.FilterSummary.PropertyName = "Name"
            'Select all the filter items
            brandFilter.SelectAll()
        Case "Color"
            Dim categoryFilter = CType(e.Filter, C1.WPF.DataFilter.ChecklistFilter)
            categoryFilter.ItemsSource = _products
            categoryFilter.ValueMemberPath = "Color"
            'Define the summary for the Checklist filter defined for Category Field.
            'This summary displays the maximum price of cars for the specific category.
            categoryFilter.FilterSummary.AggregateType = AggregateType.Max
            categoryFilter.FilterSummary.Label = "Max"
            categoryFilter.FilterSummary.PropertyName = "Price"
            'Select all the filter items
            categoryFilter.SelectAll()
        Case "Price"
            Dim priceFilter = CType(e.Filter, C1.WPF.DataFilter.RangeFilter)
            priceFilter.Maximum = _products.AsEnumerable().Max(Function(x) x.Price)
            priceFilter.Minimum = _products.AsEnumerable().Min(Function(x) x.Price)
            priceFilter.Increment = 1000
            priceFilter.Digits = 0
        Case Else
            e.Cancel = True
    End Select
End Sub
```

**csharp**

```csharp
private void C1DataFilter_FilterAutoGenerating(object sender, C1.DataFilter.FilterAutoGeneratingEventArgs e)
{
    switch (e.Property.Name)
    {
        //Set the checklist items for Brand filter
        case "Name":
            var brandFilter = (C1.WPF.DataFilter.ChecklistFilter)e.Filter;
            brandFilter.ItemsSource = _products;
            brandFilter.ValueMemberPath = "Name";
            //Define the summary for the Checklist filter defined for Brand Field.
            //This summary displays the count of cars available for each brand.
            brandFilter.FilterSummary.Label = "Count";
            brandFilter.FilterSummary.PropertyName = "Name";
            brandFilter.FilterSummary.AggregateType = AggregateType.Count;
            //Select all the filter items
            brandFilter.SelectAll();
            break;
        //Set the checklist items for Category filter
        case "Color":
            var categoryFilter = (C1.WPF.DataFilter.ChecklistFilter)e.Filter;
            categoryFilter.ItemsSource = _products;
            categoryFilter.ValueMemberPath = "Color";
            //Define the summary for the Checklist filter defined for Category Field.
            //This summary displays the maximum price of cars for the specific category.
            categoryFilter.FilterSummary.Label = "Max";
            categoryFilter.FilterSummary.PropertyName = "Price";
            categoryFilter.FilterSummary.AggregateType = AggregateType.Max;
            //Select all the filter items
            categoryFilter.SelectAll();
            break;
        //Set the minimum/maximum value for the Price filter
        case "Price":
            var priceFilter = (C1.WPF.DataFilter.RangeFilter)e.Filter;
            priceFilter.Maximum = _products.AsEnumerable().Max(x => x.Price);
            priceFilter.Minimum = _products.AsEnumerable().Min(x => x.Price);
            priceFilter.Increment = 1000;
            priceFilter.Digits = 0;
            break;
        //Cancels the creation of all other filters
        default:
            e.Cancel = true;
            break;
    }
}
```