# Filter Summaries

## Content



DataFilter control allows you to configure the Checklist filter to implement the filter summaries using [AggregateType](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.DataFilter/C1.WinUI.DataFilter.FilterSummary.AggregateType.html) property 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 _Model_ filter are listed.

![Filter Summaries](https://cdn.mescius.io/document-site-files/images/2d49eac2-0942-4770-99ef-52b14e6815bd/images/filter-summaries.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 as shown in the above example using **AggregateType** property.

```csharp
private void C1DataFilter_FilterAutoGenerating(object sender, FilterAutoGeneratingEventArgs e)
{
    foreach (Filter f in c1DataFilter.Filters)
    {
        if (f.PropertyName == "Brand")
        {
            var brandFilter = f as ChecklistFilter;
            brandFilter.FilterSummary.Label = "Models:";
            brandFilter.FilterSummary.PropertyName = "Brand";
            brandFilter.FilterSummary.AggregateType = AggregateType.Count;
        }
        if (f.PropertyName == "Model")
        {
            var modelFilter = f as ChecklistFilter;
            modelFilter.FilterSummary.AggregateType = AggregateType.Max;
            modelFilter.FilterSummary.CustomFormat = "C0";
            modelFilter.FilterSummary.Label = "Max price: ";
            modelFilter.FilterSummary.PropertyName = "Price";
        }
        if (f.PropertyName == "Price")
        {
            var modelFilter = f as RangeFilter;
            modelFilter.Maximum = _data.Max(x => (x as Car).Price);
            modelFilter.Minimum = _data.Min(x => (x as Car).Price);
            modelFilter.Increment = 1000;
            modelFilter.Format = "F0";
        }
        if (f.PropertyName == "TransmissAutomatic")
        {
            var taFilter = f as ChecklistFilter;
            taFilter.HeaderText = "Transmiss Automatic";
            taFilter.ItemsSource = new List<TransmissAutomatic>()
            {
                new TransmissAutomatic() { DisplayValue = "Yes", Value = "Yes" },
                new TransmissAutomatic() { DisplayValue = "No", Value = "No" },
                new TransmissAutomatic() { DisplayValue = "Empty", Value = null }
            };
            taFilter.DisplayMemberPath = "DisplayValue";
            taFilter.ValueMemberPath = "Value";
            taFilter.ShowSelectAll = false;
        }
        if (f.PropertyName == "DateProductionLine")
        {
            var modelFilter = f as DateRangeFilter;
            modelFilter.UpperValue = _data.Max(x => (x as Car).DateProductionLine);
            modelFilter.LowerValue = _data.Min(x => (x as Car).DateProductionLine);
            modelFilter.Maximum = modelFilter.UpperValue.Value;
            modelFilter.Minimum = modelFilter.LowerValue.Value;
        }
    }
}
```