New to Telerik Document ProcessingStart a free 30-day trial

Filters rows by comparing cell values against one or two custom criteria using relational operators; use for range-based or multi-condition filtering.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model.Filtering

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class CustomFilter : CellValuesFilterBase, IFilter

Inheritance: objectFilterBase<ICellValue>CellValuesFilterBaseCustomFilter

Implements: IFilter

Inherited Members CellValuesFilterBase.PropertyDefinitionFilterBase<ICellValue>.GetValue(Cells, int, int)FilterBase<ICellValue>.RelativeColumnIndex

Constructors

Initializes a new instance of the CustomFilter class.

C#
public CustomFilter(int relativeColumnIndex, CustomFilterCriteria criteria1, LogicalOperator logicalOperator, CustomFilterCriteria criteria2)
Parameters:relativeColumnIndexint

Relative index of the column.

criteria1CustomFilterCriteria

The first criteria.

logicalOperatorLogicalOperator

The logical operator.

criteria2CustomFilterCriteria

The second criteria.

Initializes a new instance of the CustomFilter class.

C#
public CustomFilter(int relativeColumnIndex, CustomFilterCriteria criteria)
Parameters:relativeColumnIndexint

Relative index of the column.

criteriaCustomFilterCriteria

The criteria.

Methods

Determines whether the specified object is equal to the current object.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

true if the specified object is equal to the current object; otherwise, false.

Overrides: object.Equals(object)

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()

Determines whether the row containing the specified cell value passes the filter criteria and should be shown.

C#
public override bool ShouldShowValue(object value)
Parameters:valueobject

The value retrieved by the GetValue method.

Returns:

bool

A value indicating whether the row which contains the specified value will be shown

Overrides: FilterBase<ICellValue>.ShouldShowValue(object)

Properties

Gets the first comparison criterion applied to filter cell values.

C#
public CustomFilterCriteria Criteria1 { get; }
Property Value:

The first criteria.

Gets the second comparison criterion, if specified. This is used together with Criteria1 and combined using the LogicalOperator; returns null if only one criterion is set.

C#
public CustomFilterCriteria Criteria2 { get; }
Property Value:

The second criteria.

Gets the logical operator (AND or OR) used to combine the two criteria when both are present.

C#
public LogicalOperator LogicalOperator { get; }
Property Value:

The logical operator.