New to Telerik Document ProcessingStart a free 30-day trial

Sort condition that orders rows or columns by cell text foreground color, placing cells with a specified color first or last.

Definition

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

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public sealed class ForeColorSortCondition : OrderedSortConditionBase<ThemableColor>, ISortCondition

Inheritance: objectSortConditionBase<ThemableColor>OrderedSortConditionBase<ThemableColor>ForeColorSortCondition

Implements: ISortCondition

Inherited Members OrderedSortConditionBase<ThemableColor>.SortOrderSortConditionBase<ThemableColor>.RelativeIndex

Constructors

Initializes a new sort condition that orders by cell text foreground color, targeting a specific color.

C#
public ForeColorSortCondition(int relativeIndex, ThemableColor color, SortOrder sortOrder)
Parameters:relativeIndexint

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

colorThemableColor

The color.

sortOrderSortOrder

The sort order.

Properties

Gets the target text foreground color used to identify cells during sorting.

C#
public ThemableColor Color { get; }
Property Value:

The color.

Gets the comparer that determines sort order by matching cell text foreground colors against the target color.

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

The comparer used for sorting.

Overrides: SortConditionBase<ThemableColor>.Comparer

Gets the cell property definition that identifies the text foreground color used for sorting.

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

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

Overrides: SortConditionBase<ThemableColor>.PropertyDefinition

Methods

Determines whether the specified sort condition has the same color, relative index, and sort order.

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<ThemableColor>.Equals(object)

Computes a hash code combining the target color and base sort condition properties.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: OrderedSortConditionBase<ThemableColor>.GetHashCode()

Gets the resolved text foreground color from the specified cell, with theme colors expanded to their local RGB values.

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

The cells.

rowIndexint

The row index.

columnIndexint

The column index.

Returns:

object

The value of the specified cell.

Overrides: SortConditionBase<ThemableColor>.GetValue(Cells, int, int)