New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Class that is used to define sort field and sort order for RadGrid

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GridSortExpression : IStateManager

Inheritance: objectGridSortExpression

Implements: IStateManager

Inherited Members object.Equals(object, object)object.ReferenceEquals(object, object)object.GetType()object.MemberwiseClone()

Constructors

Initializes a new instance of the GridSortExpression class.

C#
public GridSortExpression()

Properties

Gets or sets the name of the field to which sorting is applied.

C#
public string FieldName { get; set; }

Sets or gets the current sorting order.

C#
public GridSortOrder SortOrder { get; set; }

Methods

Determines whether the specified object is equal to the current GridSortExpression.

C#
public override bool Equals(object obj)
Parameters:objobjectReturns:

bool

Overrides: object.Equals(object)

Returns a hash code for the current GridSortExpression.

C#
public override int GetHashCode()
Returns:

int

Overrides: object.GetHashCode()

Parses a string representation of the sort order and returns GirdSortExpression.

C#
public static GridSortExpression Parse(string expression)
Parameters:expressionstringReturns:

GridSortExpression

Sets the sort order.

The SortOrder paremeter should be either "Ascending", "Descending" or "None".

C#
public void SetSortOrder(string SortOrder)
Parameters:SortOrderstring

This method gives the string representation of the sorting order. It can be either "ASC" or "DESC"

C#
public string SortOrderAsString()
Returns:

string

This method gives the string representation of the sorting order. It can be either "ASC" or "DESC"

C#
public static string SortOrderAsString(GridSortOrder sortOrder)
Parameters:sortOrderGridSortOrderReturns:

string

Returns a GridSortOrder enumeration based on the string input. Takes either "ASC" or "DESC"

C#
public static GridSortOrder SortOrderFromString(string sortOrder)
Parameters:sortOrderstringReturns:

GridSortOrder

Returns a string that represents the current GridSortExpression.

C#
public override string ToString()
Returns:

string

Overrides: object.ToString()