Class ColumnFilter
A column's filter: one condition, or two combined with Logic. It holds only plain values, so it can be saved, such as with the rest of a TwDataTableState, passed to a ItemsProvider, or kept on a SheetTable.
[ExcludeFromCodeCoverage]
public sealed class ColumnFilter
- Inheritance
-
ColumnFilter
- Inherited Members
Constructors
ColumnFilter()
public ColumnFilter()
Properties
First
Gets or sets the first condition.
public FilterCondition First { get; set; }
Property Value
IsActive
Gets whether either condition takes part in filtering.
public bool IsActive { get; }
Property Value
Logic
Gets or sets how the two conditions combine. Defaults to And.
public FilterLogic Logic { get; set; }
Property Value
Second
Gets or sets the second condition, or null for one condition only.
public FilterCondition? Second { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of the filter.
public ColumnFilter Clone()
Returns
- ColumnFilter
A new ColumnFilter with the same values.
Matches(object?, FilterType)
Gets whether a value passes the filter, with the same rules as the filters of TwDataTable<TItem> and TwSpreadsheet. Conditions that are not active are ignored, so an empty filter passes everything.
public bool Matches(object? value, FilterType type = FilterType.Text)
Parameters
valueobjectThe value, such as a number, a date, true or text.
typeFilterTypeThe kind of values being filtered, which decides how they are compared. Defaults to Text.