SortLevel Class
Represents sort settings for a single sort level.
- Inheritance:
- System.ObjectSortLevel
Properties
ColumnRowIndex
Gets or sets the column (or the row, if LeftToRight is true) index relative to the Range that this sort level applies to.
Value is equal to or greater than zero and less than Width (or Height, if LeftToRight is true) of the Range.
Property Value
- System.Int32
The column (or the row, if LeftToRight is true) index relative to the Range that this sort level applies to.
Exceptions
- System.InvalidOperationException
Sort level is removed from the sort state.
- System.ArgumentOutOfRangeException
Value is less than zero or is equal to or greater than Width (or Height, if LeftToRight is true) of the Range.
- System.ArgumentException
Column/row at the specified index is being sorted by the same criteria more than once. Delete the duplicate sort criteria and try again.
Comparison
Gets or sets the comparison method that compares two ExcelCells.
Default value is default comparison method based on the settings of this sort level.
public Comparison<ExcelCell> Comparison { get; set; }
Public Property Comparison As Comparison(Of ExcelCell)
Property Value
Remarks
Use this property to override default comparison method based on the settings of this sort level.
This member is not loaded from and saved to XLSX file since it is not supported by Office Open XML specification. It is used to customize GemBox.Spreadsheet functionality.
If set to null, reverts to default comparison method based on the settings of this sort level.
CustomList
Gets the custom list by which order of items to sort by.
If Descending is set to true, then sorting will be performed based on the reverse order of items.
public IList<string> CustomList { get; }
Public ReadOnly Property CustomList As IList(Of String)
Property Value
- System.Collections.Generic.IList<System.String>
The custom list by which order of items to sort by.
Descending
Gets or sets a value indicating whether to sort the values in the descending order.
Default value is false.
Property Value
- System.Boolean
true to sort the values in the descending order; otherwise, false.
Methods
SetCustomList(IEnumerable<String>)
Sets the custom list by which order of items to sort by.
public void SetCustomList(IEnumerable<string> items)
Public Sub SetCustomList(items As IEnumerable(Of String))
Parameters
items
- System.Collections.Generic.IEnumerable<System.String>
The custom list by which order of items to sort by.
SetCustomList(String[])
Sets the custom list by which order of items to sort by.
public void SetCustomList(params string[] items)
Public Sub SetCustomList(ParamArray items As String())
Parameters
items
- System.String[]
The custom list by which order of items to sort by.
ToString()
Returns a System.String that represents this SortLevel instance.
Returns
- System.String
A System.String that represents this SortLevel instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).