New to Telerik Document ProcessingStart a free 30-day trial

Filter that displays rows whose cell values match any value in a predefined list of strings, dates, or blank entries.

Definition

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

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class ValuesCollectionFilter : CellValuesFilterBase, IFilter

Inheritance: objectFilterBase<ICellValue>CellValuesFilterBaseValuesCollectionFilter

Implements: IFilter

Inherited Members CellValuesFilterBase.PropertyDefinitionFilterBase<ICellValue>.RelativeColumnIndex

Constructors

Initializes a values filter matching the specified date group items with optional blank inclusion.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<DateGroupItem> dateValues, bool blank)
Parameters:relativeColumnIndexint

Relative index of the column.

dateValuesIEnumerable<DateGroupItem>

The date values.

blankbool

The value indicating whether the cells containing blank values should be shown by the filter.

Initializes a values filter matching the specified date group items, excluding blanks.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<DateGroupItem> dateValues)
Parameters:relativeColumnIndexint

Relative index of the column.

dateValuesIEnumerable<DateGroupItem>

The date values.

Initializes a values filter matching the specified string values with optional blank inclusion.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<string> stringValues, bool blank)
Parameters:relativeColumnIndexint

Relative index of the column.

stringValuesIEnumerable<string>

The string values.

blankbool

The value indicating whether the cells containing blank values should be shown by the filter.

Initializes a values filter matching string values, date group items, and optionally blank cells.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<string> stringValues, IEnumerable<DateGroupItem> dateValues, bool blank)
Parameters:relativeColumnIndexint

Relative index of the column.

stringValuesIEnumerable<string>

The string values.

dateValuesIEnumerable<DateGroupItem>

The date values.

blankbool

The value indicating whether the cells containing blank values should be shown by the filter.

Initializes a values filter matching both string and date group items, excluding blanks.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<string> stringValues, IEnumerable<DateGroupItem> dateValues)
Parameters:relativeColumnIndexint

Relative index of the column.

stringValuesIEnumerable<string>

The string values.

dateValuesIEnumerable<DateGroupItem>

The date values.

Initializes a values filter matching the specified string values, excluding blanks.

C#
public ValuesCollectionFilter(int relativeColumnIndex, IEnumerable<string> stringValues)
Parameters:relativeColumnIndexint

Relative index of the column.

stringValuesIEnumerable<string>

The string values.

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()

Retrieves the cell value formatted as a string or DateTime based on the cell's number format for filter comparison.

C#
public override object GetValue(Cells cells, int rowIndex, int columnIndex)
Parameters:cellsCells

The cells of the worksheet.

rowIndexint

Index of the row.

columnIndexint

Index of the column.

Returns:

object

The value of the cell.

Overrides: FilterBase<ICellValue>.GetValue(Cells, int, int)

Evaluates whether the value matches any entry in the string list, date groups, or blank criteria.

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

Whether to include rows with empty or whitespace-only cell values in the filtered results.

C#
public bool Blank { get; }
Property Value:

The value indicating whether the cells containing blank values should be shown by the filter.

Date group items representing hierarchical date/time criteria (year, month, day) for filtering date-formatted cells.

C#
public IEnumerable<DateGroupItem> DateItems { get; }
Property Value:

The date items.

Text values to match against formatted cell content; matching is case-insensitive.

C#
public IEnumerable<string> StringValues { get; }
Property Value:

The string values.