[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ValueSortField

ValueSortField Class

Represents a sort field that sorts data by cell values.

Use this class to define value-based sorting in ascending order, descending order, or by a custom value list. A ValueSortField also lets you control how text values are treated during sorting through SortDataOption.

Inheritance
ValueSortField
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public class ValueSortField : SortFieldBase, IValueSortField, ISortField
Public Class ValueSortField
    Inherits SortFieldBase
    Implements IValueSortField, ISortField
Examples
worksheet.Range["A1:A4"].Value = new object[,] {
    {"10"},
    {"2"},
    {"30"},
    {"4"}
};
ValueSortField sortField = new ValueSortField(worksheet.Range["A1:A4"], SortOrder.Ascending);
sortField.DataOption = SortDataOption.TextAsNumbers;

Constructors

Name Description
ValueSortField(IRange, SortOrder)

Creates a value sort field for the specified key range and sort order.

ValueSortField(IRange, string)

Creates a value sort field that uses a custom sort list.

Use this constructor to sort by a user-defined value sequence instead of the normal ascending or descending order. The custom list string can contain values such as 3,2,5,1 or quoted text entries such as "\"High\", \"Medium\", \"Low\"".

Properties

Name Description
CustomValues

Gets or sets the custom value list, such as 3,2,5,1.

DataOption

Gets or sets the data option of the sort field.

Order

Gets or sets the sort order.

SortOn

Gets the sort type.

This value indicates that the sort field evaluates cells by values.