AutoFilterColumn.ApplyDynamicFilter(DynamicFilterType) Method
Applies a dynamic filter that shows dates that fall within a specified time period or displays values that are above or below the average.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v26.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| dynamicFilterType | DynamicFilterType | A DynamicFilterType enumeration member that specifies the filter criterion. |
Remarks
The dynamic filter can change when the data to which the filter is applied or the current system date changes.
Example
Worksheet worksheet = workbook.Worksheets["Regional sales"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Enable filtering for the specified cell range.
CellRange range = worksheet["B2:E23"];
worksheet.AutoFilter.Apply(range);
// Apply a dynamic filter to the "Sales" column to display only values that are above the average.
worksheet.AutoFilter.Columns[2].ApplyDynamicFilter(DynamicFilterType.AboveAverage);
// Apply a dynamic filter to the "Reported Date" column to display values reported this year.
worksheet.AutoFilter.Columns[3].ApplyDynamicFilter(DynamicFilterType.ThisYear);
See Also