[]
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.
public class ValueSortField : SortFieldBase, IValueSortField, ISortField
Public Class ValueSortField
Inherits SortFieldBase
Implements IValueSortField, ISortField
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;
| 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 |
| Name | Description |
|---|---|
| CustomValues | Gets or sets the custom value list, such as |
| 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. |