New to Telerik UI for WinForms? Start a free 30-day trial

Maintains the ordered sort descriptors applied to a collection view.

The collection sets each descriptor's owner and forwards descriptor changes as collection notifications.

Definition

Namespace:Telerik.WinControls.Data

Assembly:Telerik.WinControls.dll

Syntax:

C#
public class SortDescriptorCollection : NotifyCollection<SortDescriptor>, IList, ICollection, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Inheritance: objectCollection<SortDescriptor>NotifyCollection<SortDescriptor>SortDescriptorCollection

Derived Classes: GridViewSortDescriptorCollection

Implements: ICollectionIEnumerableIListINotifyCollectionChangedINotifyPropertyChanged

Inherited Members NotifyCollection<SortDescriptor>.EmptyNotifyCollection<SortDescriptor>.Move(int, int)NotifyCollection<SortDescriptor>.AddRange(params SortDescriptor[])NotifyCollection<SortDescriptor>.AddRange(IEnumerable<SortDescriptor>)NotifyCollection<SortDescriptor>.BeginUpdate()NotifyCollection<SortDescriptor>.EndUpdate()NotifyCollection<SortDescriptor>.EndUpdate(bool)NotifyCollection<SortDescriptor>.DeferRefresh()NotifyCollection<SortDescriptor>.MoveItem(int, int)NotifyCollection<SortDescriptor>.CreateEventArguments(NotifyCollectionChangedAction)NotifyCollection<SortDescriptor>.OnCollectionChanged(NotifyCollectionChangedEventArgs)NotifyCollection<SortDescriptor>.OnPropertyChanged(PropertyChangedEventArgs)NotifyCollection<SortDescriptor>.OnPropertyChanged(string)NotifyCollection<SortDescriptor>.VersionNotifyCollection<SortDescriptor>.SuspendedNotifyCollection<SortDescriptor>.CollectionChangedNotifyCollection<SortDescriptor>.PropertyChangedCollection<SortDescriptor>.Add(SortDescriptor)Collection<SortDescriptor>.Clear()Collection<SortDescriptor>.CopyTo(SortDescriptor[], int)Collection<SortDescriptor>.Contains(SortDescriptor)Collection<SortDescriptor>.GetEnumerator()Collection<SortDescriptor>.IndexOf(SortDescriptor)Collection<SortDescriptor>.Insert(int, SortDescriptor)Collection<SortDescriptor>.Remove(SortDescriptor)Collection<SortDescriptor>.RemoveAt(int)Collection<SortDescriptor>.CountCollection<SortDescriptor>.ItemsCollection<SortDescriptor>.this[int]...

Constructors

C#
public SortDescriptorCollection()

Properties

Gets or sets the expression.

C#
public virtual string Expression { get; set; }
Property Value:

The expression.

Gets or sets a value indicating whether fields with names that differ only in the casing should be considered different.

C#
public bool UseCaseSensitiveFieldNames { get; set; }

Methods

Adds the specified property name.

C#
public void Add(string propertyName, ListSortDirection direction)
Parameters:propertyNamestring

Name of the property.

directionListSortDirection

The direction.

Detaches ownership and property-change subscriptions from all descriptors before clearing the collection.

C#
protected override void ClearItems()

Overrides: NotifyCollection<SortDescriptor>.ClearItems()

Determines whether [contains] [the specified property name].

C#
public bool Contains(string propertyName)
Parameters:propertyNamestring

Name of the property.

Returns:

bool

true if [contains] [the specified property name]; otherwise, false.

Creates a collection notification for an operation involving one descriptor.

C#
protected override NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object item, int index)
Parameters:actionNotifyCollectionChangedAction

The collection operation.

itemobject

The descriptor involved in the operation.

indexint

The descriptor's index.

Returns:

NotifyCollectionChangedEventArgs

Event data that includes the descriptor's property name when the item is a SortDescriptor.

Overrides: NotifyCollection<SortDescriptor>.CreateEventArguments(NotifyCollectionChangedAction, object, int)

Creates a collection notification for an operation that replaces one item with another.

C#
protected override NotifyCollectionChangedEventArgs CreateEventArguments(NotifyCollectionChangedAction action, object oldItem, object item, int index)
Parameters:actionNotifyCollectionChangedAction

The collection operation.

oldItemobject

The item being replaced.

itemobject

The replacement item.

indexint

The index of the replacement.

Returns:

NotifyCollectionChangedEventArgs

Event data that includes the replacement descriptor's property name when the item is a SortDescriptor.

Overrides: NotifyCollection<SortDescriptor>.CreateEventArguments(NotifyCollectionChangedAction, object, object, int)

Indexes the of.

C#
public int IndexOf(string propertyName)
Parameters:propertyNamestring

Name of the property.

Returns:

int

Inserts a descriptor unless the first descriptor with the same property name has the same direction, then attaches ownership and change notifications.

C#
protected override void InsertItem(int index, SortDescriptor item)
Parameters:indexint

The position at which to insert the descriptor.

itemSortDescriptor

The descriptor to insert.

Overrides: NotifyCollection<SortDescriptor>.InsertItem(int, SortDescriptor)

Removes the specified property name.

C#
public bool Remove(string propertyName)
Parameters:propertyNamestring

Name of the property.

Returns:

bool

Removes a descriptor and detaches its owner and property-change subscription.

C#
protected override void RemoveItem(int index)
Parameters:indexint

The position of the descriptor to remove.

Overrides: NotifyCollection<SortDescriptor>.RemoveItem(int)

Replaces a descriptor and updates ownership and property-change subscriptions for both instances.

C#
protected override void SetItem(int index, SortDescriptor item)
Parameters:indexint

The position of the descriptor to replace.

itemSortDescriptor

The replacement descriptor.

Overrides: NotifyCollection<SortDescriptor>.SetItem(int, SortDescriptor)

Returns a string that represents this instance.

C#
public override string ToString()
Returns:

string

A string that represents this instance.

Overrides: object.ToString()