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

A collection of RadListViewSortExpression objects. Depending on the value of AllowMultiFieldSorting it holds single or multiple sort expressions.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
public class RadListViewSortExpressionCollection : IList, ICollection, IEnumerable, IStateManager

Inheritance: objectRadListViewSortExpressionCollection

Implements: ICollectionIEnumerableIListIStateManager

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

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.

C#
[Browsable(false)]
public bool AllowMultiFieldSorting { get; set; }

Allow the no-sort state when changing sort order.

C#
[Browsable(false)]
public bool AllowNaturalSort { get; set; }

Returns the number of items in the RadListViewSortExpressionCollection.

C#
[Browsable(false)]
public int Count { get; }

Implements: ICollection.Count

Gets a value indicating whether access to the RadListViewSortExpressionCollection is synchronized (thread safe).

C#
[Browsable(false)]
public bool IsSynchronized { get; }

Implements: ICollection.IsSynchronized

Gets an object that can be used to synchronize access to the GirdSortExpressionCollection.
C#
[Browsable(false)]
public object SyncRoot { get; }

Implements: ICollection.SyncRoot

This is the default indexer of the collection - takes an integer value.

C#
public RadListViewSortExpression this[int index] { get; set; }
Parameters:indexint

Methods

Adds a RadListViewSortExpression to the collection.

C#
public int Add(object value)
Parameters:valueobjectReturns:

int

Implements: IList.Add(object)

Adds a RadListViewSortExpression to the collection at the specified index.

C#
public void AddAt(int index, RadListViewSortExpression sortExpression)
Parameters:indexintsortExpressionRadListViewSortExpression

As a convenience feature, adding at an index greater than zero will set the AllowMultiFieldSorting to true.

If AllowMultiFieldSorting is true adds the sortExpression in the collection. Else any other expression previously stored in the collection wioll be removed

C#
public void AddSortExpression(RadListViewSortExpression sortExpression)
Parameters:sortExpressionRadListViewSortExpression

If AllowMultiFieldSorting is true adds the sortExpression in the collection. Else any other expression previously stored in the collection wioll be removed

C#
public void AddSortExpression(string expression)
Parameters:expressionstring

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

C#
public void ChangeSortOrder(string expression)
Parameters:expressionstring

Clears the RadListViewSortExpressionCollection of all items.

C#
public void Clear()

Implements: IList.Clear()

Returns true or false depending on whether the specified sorting expression exists in the collection. Takes a string parameter.

C#
public bool ContainsExpression(string expression)
Parameters:expressionstringReturns:

bool

Returns true or false depending on whether the specified sorting expression exists in the collection. Takes a RadListViewSortExpression parameter.

C#
public bool ContainsSortExpression(RadListViewSortExpression sortExpression)
Parameters:sortExpressionRadListViewSortExpressionReturns:

bool

Returns an enumerator that iterates through the RadListViewSortExpressionCollection.

C#
public IEnumerator GetEnumerator()
Returns:

IEnumerator

Implements: IEnumerable.GetEnumerator()

Find a SortExpression in the collection if it contains any with sort field = expression

C#
public RadListViewSortExpression GetExpression(string expression)
Parameters:expressionstring

sort field

Returns:

RadListViewSortExpression

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

C#
public string GetSortString()
Returns:

string

Comma separated list of sort fields and optionaly sort-order, null if there are no sort expressions in the collection

Searches for the specified RadListViewSortExpression and returns the zero-based index of the first occurrence within the entire RadListViewSortExpressionCollection.

C#
public int IndexOf(RadListViewSortExpression viewSortExpression)
Parameters:viewSortExpressionRadListViewSortExpressionReturns:

int

Removes the specified RadListViewSortExpression from the collection.

C#
public void RemoveSortExpression(RadListViewSortExpression sortExpression)
Parameters:sortExpressionRadListViewSortExpression