New to Telerik UI for WinForms? Download free 30-day trial

Events

There are two events that are raised when the data in the RadGridView is filtered. The first one is the FilterChanging event and it is raised before the data is filtered. The second one is the FilterChanged event which is raised after the data is filtered.

void radGridView1_FilterChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e)
{

}

void radGridView1_FilterChanging(object sender, Telerik.WinControls.UI.GridViewCollectionChangingEventArgs e)
{

}

From the event arguments of both events you can access the following data:

  • Action: an enumeration with values: Add, Remove, ItemChanged and Reset. The Action property notifies if a FilterDescriptor is added, removed, modified or the FilterDescriptors collection is cleared.

  • NewItems: List of added, edited or removed FilterDescriptors. For each FilterDescriptor you can get its PropertyName, Operator, Value and Expression.

You are also able to cancel the filtering operation by setting the Cancel property to True.

void radGridView1_FilterChanging1(object sender, Telerik.WinControls.UI.GridViewCollectionChangingEventArgs e)
{
    e.Cancel = true;
}

Since the FilterDescriptors collection implements the INotifyCollectionChanged interface, you can use its CollectionChanged event:

this.radGridView1.FilterDescriptors.CollectionChanged += new Telerik.WinControls.Data.NotifyCollectionChangedEventHandler(FilterDescriptors_CollectionChanged);
void FilterDescriptors_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
{

}

The arguments of this event provide the same data as the FilterChanged event.