GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    SortLevelCollection Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a collection of sort levels.

    • C#
    • VB.NET
    public sealed class SortLevelCollection : IEnumerable<SortLevel>, IEnumerable
    Public NotInheritable Class SortLevelCollection
        Implements IEnumerable(Of SortLevel), IEnumerable
    Inheritance:
    System.Object
    SortLevelCollection
    Implements
    System.Collections.Generic.IEnumerable<SortLevel>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of sort levels actually contained in the SortLevelCollection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of sort levels actually contained in the SortLevelCollection.

    Item[Int32]

    Gets the SortLevel at the specified index.

    • C#
    • VB.NET
    public SortLevel this[int index] { get; }
    Public ReadOnly Property Item(index As Integer) As SortLevel
    Parameters
    index
    System.Int32

    The zero-based index of the SortLevel to get.

    Property Value
    SortLevel

    The SortLevel at the specified index.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or is equal to or greater than Count.

    Methods

    Add(Int32)

    Adds a new SortLevel applied to a column (or a row, if LeftToRight is true) with the specified index into the SortLevelCollection.

    • C#
    • VB.NET
    public SortLevel Add(int columnRowIndex)
    Public Function Add(columnRowIndex As Integer) As SortLevel
    Parameters
    columnRowIndex
    System.Int32

    Index of the column (or the row, if LeftToRight is true) relative to the Range that an added SortLevel applies to.

    Returns
    SortLevel

    A new SortLevel applied to a column (or a row, if LeftToRight is true) with the specified index relative to the Range.

    Exceptions
    System.ArgumentOutOfRangeException

    columnRowIndex 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.

    Clear()

    Removes all SortLevels from the SortLevelCollection.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Get(Int32)

    Gets the sort level applied to a column (or a row, if LeftToRight is true) with the specified index (relative to the Range) or null if such sort level doesn't exist.

    • C#
    • VB.NET
    public SortLevel Get(int columnRowIndex)
    Public Function Get(columnRowIndex As Integer) As SortLevel
    Parameters
    columnRowIndex
    System.Int32

    The index of a column (or a row, if LeftToRight is true) relative to the Range that a returned SortLevel applies to.

    Returns
    SortLevel

    The sort level applied to a column (or a row, if LeftToRight is true) with the specified index (relative to the Range) or null if such sort level doesn't exist.

    GetEnumerator()

    Returns an enumerator that iterates through the sort levels.

    • C#
    • VB.NET
    public IEnumerator<SortLevel> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of SortLevel)
    Returns
    System.Collections.Generic.IEnumerator<SortLevel>

    An enumerator that can be used to iterate through the sort levels.

    Insert(Int32, Int32)

    Inserts a new SortLevel applied to a column (or a row, if LeftToRight is true) with the specified index into the SortLevelCollection at the specified index.

    • C#
    • VB.NET
    public SortLevel Insert(int index, int columnRowIndex)
    Public Function Insert(index As Integer, columnRowIndex As Integer) As SortLevel
    Parameters
    index
    System.Int32

    The zero-based index at which new SortLevel should be inserted.

    columnRowIndex
    System.Int32

    Index of the column (or the row, if LeftToRight is true) relative to the Range that an inserted SortLevel applies to.

    Returns
    SortLevel

    A new SortLevel applied to a column (or a row, if LeftToRight is true) with the specified index relative to the Range.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or is equal to or greater than Count.

    System.ArgumentOutOfRangeException

    columnRowIndex 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.

    Move(Int32, Int32)

    Moves the SortLevel at the specified index to a new location in the SortLevelCollection.

    • C#
    • VB.NET
    public void Move(int oldIndex, int newIndex)
    Public Sub Move(oldIndex As Integer, newIndex As Integer)
    Parameters
    oldIndex
    System.Int32

    The zero-based index specifying the location of the SortLevel to be moved.

    newIndex
    System.Int32

    The zero-based index specifying the new location of the SortLevel.

    Exceptions
    System.ArgumentOutOfRangeException

    oldIndex is less than zero or is equal to or greater than Count.

    System.ArgumentOutOfRangeException

    newIndex is less than zero or is equal to or greater than Count.

    Remove(SortLevel)

    Removes the specific SortLevel from the SortLevelCollection.

    • C#
    • VB.NET
    public bool Remove(SortLevel sortLevel)
    Public Function Remove(sortLevel As SortLevel) As Boolean
    Parameters
    sortLevel
    SortLevel

    The SortLevel to remove from the SortLevelCollection.

    Returns
    System.Boolean

    true if SortLevel is successfully removed; otherwise, false. This method also returns false if SortLevel was null or was not found in the original SortLevelCollection.

    Remove(Int32)

    Removes a SortLevel applied to a column (or a row, if LeftToRight is true) with the specified index from the SortLevelCollection.

    • C#
    • VB.NET
    public bool Remove(int columnRowIndex)
    Public Function Remove(columnRowIndex As Integer) As Boolean
    Parameters
    columnRowIndex
    System.Int32

    Index of the column (or the row, if LeftToRight is true) relative to the Range that a removed SortLevel applies to.

    Returns
    System.Boolean

    true if SortLevel is successfully removed; otherwise, false. This method also returns false if SortLevel with the specified column/row index was not found in the original SortLevelCollection.

    RemoveAt(Int32)

    Removes the SortLevel at the specified index of the SortLevelCollection.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the SortLevel to remove.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or is equal to or greater than Count.

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.