[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IValueSortField

IValueSortField Interface

Represents the sort field by cell value (ascending or descending or custom value list).

Use this interface to describe how a range is sorted by cell values. A value sort field can sort in ascending or descending order, or by a custom value list configured through CustomValues. It also exposes the sort field's data option through DataOption.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IValueSortField : ISortField
Public Interface IValueSortField
    Inherits ISortField
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Name", "Score"},
    {"A", 80},
    {"B", 95},
    {"C", 88}
};
IValueSortField sortField = new ValueSortField(worksheet.Range["B2:B4"], SortOrder.Descending);
sortField.DataOption = SortDataOption.Normal;
worksheet.Range["A2:B4"].Sort(SortOrientation.Columns, false, sortField);

Properties

Name Description
CustomValues

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

If this property is not an empty string, the sort order is determined by the custom values list.

DataOption

Gets or sets the data option of the sort field.

Order

Gets or sets the sort order.