'Declaration Public Class FilterAutoGeneratingEventArgs Inherits System.ComponentModel.CancelEventArgs
public class FilterAutoGeneratingEventArgs : System.ComponentModel.CancelEventArgs
'Declaration Public Class FilterAutoGeneratingEventArgs Inherits System.ComponentModel.CancelEventArgs
public class FilterAutoGeneratingEventArgs : System.ComponentModel.CancelEventArgs
This class provides data for the FilterAutoGenerating event of the C1DataFilter control. The FilterAutoGenerating event gets fired before a filter is added to the FilterCollection. This event allows you to modify the automatically generated filters or to cancel the generation of filters. The listing below provides the details about the event data.
private void C1DataFilter1_FilterAutoGenerating(object sender, C1.DataFilter.FilterAutoGeneratingEventArgs e)
{
switch (e.Property.Name)
{
//Set the checklist items for Brand filter
case "Brand":
var brandFilter = (C1.Win.DataFilter.ChecklistFilter) e.Filter;
brandFilter.ItemsSource = _carsTable;
brandFilter.ValueMemberPath = "Brand";
brandFilter.SelectAll();
break;
//Set the checklist items for Category filter
case "Category":
var categoryFilter = (C1.Win.DataFilter.ChecklistFilter) e.Filter;
categoryFilter.ItemsSource = _carsTable;
categoryFilter.ValueMemberPath = "Category";
categoryFilter.SelectAll();
break;
//Set the minimum/maximum value for the Price filter
case "Price":
var priceFilter = (C1.Win.DataFilter.RangeFilter) e.Filter;
priceFilter.Maximum = _carsTable.AsEnumerable().Max(x = >x.Field < double > ("Price"));
priceFilter.Minimum = _carsTable.AsEnumerable().Min(x = >x.Field < double > ("Price"));
priceFilter.Increment = 1000;
priceFilter.Digits = 0;
break;
//Cancels the creation of all other filters
default:
e.Cancel = true;
break;
}
}
System.Object
System.EventArgs
System.ComponentModel.CancelEventArgs
C1.DataFilter.FilterAutoGeneratingEventArgs