Spread for ASP.NET 11 Product Documentation
Creating a Completely Custom Filter
Spread for ASP.NET 11 Product Documentation > Developer's Guide > Customizing User Interaction > Managing Filtering of Rows of User Data > Customizing Simple Filtering of Rows of User Data > Creating a Completely Custom Filter

You can create a custom filter that you can then include in the filter column definition collection. In order to create a custom filter, follow these steps:

  1. Create a class that inherits from FarPoint.Web.Spread.BaseFilterItem or FarPoint.Web.Spread.DefaultFilterItem.
  2. Override DisplayName property to return the name to be displayed in the drop-down list of filter items.
  3. Override the ShowInDropDown method to specify if this filter item should be displayed in the drop-down list given the current filtered in rows. If the custom filter does not contain this item then the filter is not applied.
  4. Override the Filter method to perform the filter action on the specified column.
  5. Override the Serialize and Deserialize methods. Make calls to the base.Serialize and base.Deserialize methods unless your methods handle persisting the default properties.
  6. Create a HideRowFilter or StyleRowFilter object.
  7. Add the custom filter to the custom filter’s list of the column filter definition in the row filtering object from the previous step.

If you are creating a custom filter item and you display a modal dialog inside the Filter method of the filter item, then after the dialog goes away, call the IRowFilter interface ResetCachedIntersectedFilteredInRowIndexes method.

C#
Copy Code
FpSpread1.Sheets(0).RowFilter.ResetCachedIntersectedFilteredInRowIndexes

More information about creating custom filters is available on our online technical support forum (see the Read Me for more information).

See Also