Handle Column Filter Server Side Events

Handling Server Side Event on Applying Column Filter

There are two main events as detailed below.

  1. OnBeforeColumnFilter: Fires before the filter is going to be applied on a column.
  2. OnAfterColumnFilter: Fires after the filter has been applied on a column.

Here is the ASPX script of the Aspose.Cells.GridWeb component to add and assign the aforementioned events.

These events can be used to get useful information about the filtering process such as column index and value on which filter has to be applied. Following is the snippet demonstrating the usage of OnBeforeColumnFilter event to retrieve the column index and value which user has selected on GridWeb UI for filtering.

On the other hand, if the requirement is to get number of filtered rows after the filter has been applied then you can use the OnAfterColumnFilter event as demonstrated below.