New to Telerik Document ProcessingStart a free 30-day trial

Filter that displays only the top or bottom N items or percentage of items by numeric value in a column.

Definition

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

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class TopFilter : CellValuesFilterBase, IFilter

Inheritance: objectFilterBase<ICellValue>CellValuesFilterBaseTopFilter

Implements: IFilter

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

Constructors

Initializes a new top filter with the specified filter type and count or percentage threshold.

C#
public TopFilter(int relativeColumnIndex, TopFilterType topFilterType, double value)
Parameters:relativeColumnIndexint

The relative index of the column.

topFilterTypeTopFilterType

Type of the top filter.

valuedouble

Gets the value which indicates how many or what percent of the items covered by the filter should be shown.

Initializes a new top filter showing the top 10 numeric values by default.

C#
public TopFilter(int relativeColumnIndex)
Parameters:relativeColumnIndexint

The relative index of the column.

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

Evaluates whether the numeric value ranks within the configured top or bottom threshold.

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

Filter type controlling whether to show top or bottom items by count or percentage.

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

The type of the top filter.

Number of items or percentage (depending on filter type) to display from the sorted column values.

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

The value.