FilterColumn Class
Represents filter and sort settings for a single filter column.
- Inheritance:
- System.ObjectFilterColumn
Properties
Filter
Gets the filter settings applied to this column or null if no filter settings are applied to this column.
Property Value
The filter settings applied to this column or null if no filter settings are applied to this column.
HiddenAutoButton
Gets or sets a value indicating whether the AutoFilter button for this column is hidden.
Default value is false.
Property Value
- System.Boolean
true if the AutoFilter button for this column is hidden; otherwise, false.
Index
Gets the column index relative to the Range that this column filter applies to.
Value is equal to or greater than zero and less than Width of the Range.
Property Value
- System.Int32
The column index relative to the Range that this filter column applies to.
Match
Gets or sets the method that defines a set of criteria and determines whether the specified ExcelCell meets those criteria.
Default value is default method based on the settings of this filter.
public Predicate<ExcelCell> Match { get; set; }
Public Property Match As Predicate(Of ExcelCell)
Property Value
- System.Predicate<ExcelCell>
The method that defines a set of criteria and determines whether the specified ExcelCell meets those criteria.
Remarks
Use this property to override default method that is based on the settings of this filter.
This member is not loaded from and saved to XLSX file since it is not supported by Office Open XML specification. It is used to customize GemBox.Spreadsheet functionality.
If set to null, reverts to default method based on the settings of this filter.
ShowButton
Gets or sets a value indicating whether the filter button is visible.
For example, when the cell containing the filter button is merged with another cell, the filter button may be hidden, and not drawn.
Default value is true.
Property Value
- System.Boolean
true if the filter button is visible; otherwise, false.
Sort
Gets the sort settings applied to this column or null if no sort settings are applied to this column.
Property Value
The sort settings applied to this column or null if no sort settings are applied to this column.
Methods
AddSort()
Adds a SortLevel to this column.
Previous sort levels are maintained. If this FilterColumn already specifies a sort level (Sort is not equal to null) it will be removed before a new one is added.
Use members of a returned SortLevel to specify sort settings.
Returns
ClearFilter()
Clears the filter from this FilterColumn.
ClearSort()
Clears the sort level from this FilterColumn.
SetCustomFilter()
Sets a CustomFilter to this column.
CustomFilter filters by a one or two conditions (operators and values).
Use members of a returned CustomFilter to specify filter settings.
Returns
Remarks
If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.
SetDynamicFilter()
Sets a DynamicFilter to this column.
DynamicFilter filters by a dynamic criteria that can change, either with the data itself (e.g., "above average") or with the current system date (e.g., show values for "today").
Use members of a returned DynamicFilter to specify filter settings.
Returns
Remarks
If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.
SetSort()
Sets a SortLevel to this column.
All other sort levels are cleared.
Use members of a returned SortLevel to specify sort settings.
Returns
SetTop10Filter()
Sets a Top10Filter to this column.
Top10Filter filters by a top N (percent or number of items).
Use members of a returned Top10Filter to specify filter settings.
Returns
Remarks
If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.
SetValuesFilter()
Sets a ValuesFilter to this column.
ValuesFilter filters by a list of values.
Use members of a returned ValuesFilter to specify filter settings.
Returns
Remarks
If this FilterColumn already specifies a filter (Filter is not equal to null), it will be overridden.
ToString()
Returns a System.String that represents this FilterColumn instance.
Returns
- System.String
A System.String that represents this FilterColumn instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).