[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISortField

ISortField Interface

Represents a sort field.

A sort field defines one sort key within a collection of sort conditions. It specifies the range used as the sort key, the priority used in multi-field sorting, and the sort type represented by a specific subinterface such as value, cell color, font color, or icon sorting. Sort fields are typically managed through SortFields.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface ISortField
Public Interface ISortField
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Name", "Score"},
    {"Tom", 90},
    {"Amy", 80},
    {"Ken", 95}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B4"], true);
table.Sort.SortFields.Add(new ValueSortField(worksheet.Range["B1:B4"], SortOrder.Ascending));
ISortField sortField = table.Sort.SortFields[0];
sortField.Priority = 1;

Properties

Name Description
Key

Gets the sort key range.

This property represents the range used as the sort key for this ISortField.

Priority

Gets or sets the priority of the ISortField.

This value specifies the precedence of the sort field when multiple sort fields are used in the same sort operation.

SortOn

Gets the sort type.

This value indicates the criterion used by the sort field, such as values, cell color, font color, or icons.