New to Telerik Document ProcessingStart a free 30-day trial

Sort condition that orders cell values according to a custom list sequence, placing matching items first.

Definition

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

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public sealed class CustomValuesSortCondition : OrderedSortConditionBase<ICellValue>, ISortCondition

Inheritance: objectSortConditionBase<ICellValue>OrderedSortConditionBase<ICellValue>CustomValuesSortCondition

Implements: ISortCondition

Inherited Members OrderedSortConditionBase<ICellValue>.SortOrderSortConditionBase<ICellValue>.GetValue(Cells, int, int)SortConditionBase<ICellValue>.RelativeIndex

Constructors

Initializes a new instance of the CustomValuesSortCondition class with a custom list defining the sort order.

C#
public CustomValuesSortCondition(int relativeIndex, string[] customList, SortOrder sortOrder)
Parameters:relativeIndexint

Gets the index of the row or column that is key for sorting relative to the sorted range.

customListstring[]

The custom list.

sortOrderSortOrder

The sort order.

Methods

Determines whether the specified object is a CustomValuesSortCondition with the same custom list and settings.

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: OrderedSortConditionBase<ICellValue>.Equals(object)

Computes a hash code combining the base sort condition hash and the custom list content.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: OrderedSortConditionBase<ICellValue>.GetHashCode()

Properties

Gets the comparer that ranks values by their position in the custom list.

C#
public override IComparer<SortValue> Comparer { get; }
Property Value:

The comparer used for sorting.

Overrides: SortConditionBase<ICellValue>.Comparer

Gets the ordered array of strings defining the custom sort sequence.

C#
public string[] CustomList { get; }
Property Value:

The custom list.

Gets the cell value property definition used for custom list comparison.

C#
protected override IPropertyDefinition<ICellValue> PropertyDefinition { get; }
Property Value:

The property definition of the property which is used for sorting.

Overrides: SortConditionBase<ICellValue>.PropertyDefinition