menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SortState - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SortState

    Holds information like property name and sort direction for a sorted column in a GridTreeControl.

    Inheritance
    System.Object
    SortState
    Implements
    System.IComparable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Controls.Grid
    Assembly: Syncfusion.Grid.Wpf.dll
    Syntax
    public class SortState : IComparable

    Constructors

    SortState()

    Default constructor.

    Declaration
    public SortState()

    SortState(String, ListSortDirection)

    Constructor.

    Declaration
    public SortState(string property, ListSortDirection direction)
    Parameters
    Type Name Description
    System.String property

    The mappingname for the sorted column.

    System.ComponentModel.ListSortDirection direction

    The ListSortDirection of teh sorted column.

    Properties

    Direction

    Gets or sets the ListSortDirection for the column.

    Declaration
    public ListSortDirection Direction { get; set; }
    Property Value
    Type
    System.ComponentModel.ListSortDirection

    Property

    Gets or sets the name of the column.

    Declaration
    public string Property { get; set; }
    Property Value
    Type
    System.String

    Methods

    GetCompositeString(String, ListSortDirection)

    Takes a property name and ListSortDirection objct and returns a string consisting of the property name followed by a space followed by either ASC or DESC depending upon the ListSortDirection.

    Declaration
    public static string GetCompositeString(string property, ListSortDirection direction)
    Parameters
    Type Name Description
    System.String property

    The property name.

    System.ComponentModel.ListSortDirection direction

    The ListSortDirection.

    Returns
    Type Description
    System.String

    The string consisting of the property name followed by a space followed by either ASC or DESC.

    GetSortStatesFromString(String)

    Takes a comma separated string holding one or more sorted column names along with their sort direction and returns a collection of SortState objects matching the contents of the string.

    Declaration
    public static List<SortState> GetSortStatesFromString(string sortString)
    Parameters
    Type Name Description
    System.String sortString

    A string holding one or more column names followed by ASC or DESC separated by commas.

    Returns
    Type Description
    System.Collections.Generic.List<SortState>

    A list of SortState objects.

    Remarks

    One example of a valid string would be "States Desc, Cities ASC, Salaries DESC". This string reflects a sorted GridTreeControl that is first sorted on States in descending order, then on Cities in ascending order, and finally on Salaries in descending order.

    GetSortStringFromStates(List<SortState>)

    Takes a collection of SortStates and returns a string the represent the collection.

    Declaration
    public static string GetSortStringFromStates(List<SortState> states)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SortState> states

    The SortStates collection.

    Returns
    Type Description
    System.String

    A comma separated string holding one or more sorted column names along with their sort direction as determined by the content of the collection.

    Implements

    System.IComparable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved