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:
- Create a class that inherits from FarPoint.Web.Spread.BaseFilterItem or FarPoint.Web.Spread.DefaultFilterItem.
- Override DisplayName property to return the name to be displayed in the drop-down list of filter items.
- 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.
- Override the Filter method to perform the filter action on the specified column.
- Override the Serialize and Deserialize methods. Make calls to the base.Serialize and base.Deserialize methods unless your methods handle persisting the default properties.
- Create a HideRowFilter or StyleRowFilter object.
- 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).