[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISortFields

ISortFields Interface

Represents the sort condition list.

Provides access to the ISortField entries used by an ISort operation. Use this interface to manage the sort fields that define how data is sorted when the sort is applied.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface ISortFields
Public Interface ISortFields
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Name", "Score"},
    {"Tom", 90},
    {"Amy", 80},
    {"Tom", 70}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B4"], true);
ISortFields sortFields = table.Sort.SortFields;
sortFields.Add(new ValueSortField(worksheet.Range["A2:A4"], SortOrder.Ascending));
table.Sort.Apply();

Properties

Name Description
Count

Gets the number of sort fields in the sort field list.

This property represents the number of sort fields in this sort field collection.

this[int]

Gets the sort field at the specified index in the sort field list.

Use this indexer to retrieve a sort field that has been added to the current ISortFields collection.

Methods

Name Description
Add(ISortField)

Adds a sort field.

Use this method to add a sort condition, such as a value, icon, font color, or cell color sort field, to the sort field list returned by SortFields. After the required sort fields are added, call Apply() to apply the sort.

Clear()

Clears the sort field list.

Removes all sort fields from the sort condition list returned by SortFields. After this method is called, the sort no longer has any configured sort conditions until new ISortField entries are added.

Remove(ISortField)

Removes a sort field.