A collection of GridSortExpression objects. Depending on the value of AllowMultiColumnSorting it holds single or multiple sort expressions.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GridSortExpressionCollection : IList, ICollection, IEnumerable, IStateManager
Inheritance: objectGridSortExpressionCollection
Implements:
Inherited Members
Constructors
Initializes a new instance of the GridSortExpressionCollection class.
public GridSortExpressionCollection()
Initializes a new instance of the GridSortExpressionCollection class with the specified list.
Properties
If false, the collection can contain only one sort expression at a time. Trying to add a new one in this case will delete the existing expression or will change the sort order if its FiledName is the same.
[Browsable(false)]
public bool AllowMultiColumnSorting { get; set; }
Allow the no-sort state when changing sort order.
[Browsable(false)]
public bool AllowNaturalSort { get; set; }
Returns the number of items in the GridSortExpressionCollection.
[Browsable(false)]
public int Count { get; }
Implements:
Gets a value indicating whether access to the GridSortExpressionCollection is synchronized (thread safe).
[Browsable(false)]
public bool IsSynchronized { get; }
Implements:
This is the default indexer of the collection - takes an integer value.
Methods
Adds a GridSortExpression to the collection.
Adds a GridSortExpression to the collection at the specified index.
public void AddAt(int index, GridSortExpression sortExpression)
As a convenience feature, adding at an index greater than zero will set the AllowMultiColumnSorting to true.
If AllowMultiColumnSorting is true adds the sortExpression in the collection. Else any other expression previously stored in the collection wioll be removed
public void AddSortExpression(GridSortExpression sortExpression)
If AllowMultiColumnSorting is true adds the sortExpression in the collection. Else any other expression previously stored in the collection wioll be removed
public void AddSortExpression(string expression)
String containing sort field and optionaly sort order (ASC or DESC)
Adds the sort field (expression parameter) if the collection does not alreqady contain the field. Else the sort order of the field will be inverted. The default change order is Asc -> Desc -> No Sort. The No-Sort state can be controlled using AllowNaturalSort property
Clears the GridSortExpressionCollection of all items.
public void Clear()
Implements:
Returns true or false depending on whether the specified sorting expression exists in the collection. Takes a GridSortExpression parameter.
public bool ContainsSortExpression(GridSortExpression sortExpression)
Returns an enumerator that iterates through the GridSortExpressionCollection.
Find a SortExpression in the collection if it contains any with sort field = expression
public GridSortExpression GetExpression(string expression)
sort field
Returns:Get a comma separated list of sort fields and sort-order, in the same format used by DataView.Sort string expression. Returns null (Nothing) if there are no sort expressions in the collection
public string GetSortString()
Comma separated list of sort fields and optionaly sort-order, null if there are no sort expressions in the collection
Searches for the specified GridSortExpression and returns the zero-based index of the first occurrence within the entire GridSortExpressionCollection.
public int IndexOf(GridSortExpression gridSortExpression)
Removes the specified GridSortExpression from the collection.
public void RemoveSortExpression(GridSortExpression sortExpression)
Tries to find a GridSortExpression by providing an expression string. Otherwise returns false.
public bool TryGetExpression(string expression, out GridSortExpression sortExpression)
The expression to search for.
sortExpressionGridSortExpressionThe sort expression.
Returns:Returns false a sort expression have not been found.