[]
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.
public interface IValueSortField : ISortField
Public Interface IValueSortField
Inherits ISortField
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);
| Name | Description |
|---|---|
| CustomValues | Gets or sets the custom value list, such as 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. |