Table of Contents

Class ExBindingList<T>

Namespace
ExControls
Assembly
ExControls.dll

Provides a generic collection that supports data binding and sorting.

public class ExBindingList<T> : BindingList<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IBindingList, IList, ICollection, IEnumerable, ICancelAddNew, IRaiseItemChangedEvents

Type Parameters

T

type of the items

Inheritance
ExBindingList<T>
Implements
Inherited Members
Extension Methods

Constructors

ExBindingList()

Initializes a new instance of the ExBindingList<T> class.

public ExBindingList()

ExBindingList(IList<T>)

Initializes a new instance of the ExBindingList<T> class.

public ExBindingList(IList<T> list)

Parameters

list IList<T>

list of items wrapped by the binding list

Properties

FireEventOnSort

Gets or sets whether to trigger an event when sorting items in a collection.

public bool FireEventOnSort { get; set; }

Property Value

bool

IsSortedCore

Gets a value indicating whether the list is sorted.

protected override bool IsSortedCore { get; }

Property Value

bool

SortDirectionCore

Gets the direction the list is sorted.

protected override ListSortDirection SortDirectionCore { get; }

Property Value

ListSortDirection

SortPropertyCore

Gets the property descriptor that is used for sorting the list if sorting is implemented in a derived class; otherwise, returns null.

protected override PropertyDescriptor? SortPropertyCore { get; }

Property Value

PropertyDescriptor

Sortable

Gets or sets whether collection is sortable.

public bool Sortable { get; set; }

Property Value

bool

SupportsSortingCore

Gets a value indicating whether the list supports sorting.

protected override bool SupportsSortingCore { get; }

Property Value

bool

Methods

AddRange(IEnumerable<T>)

Adds the elements of the specified collection to the end of the ExBindingList<T> and raises a single ListChanged event for all of them.

public void AddRange(IEnumerable<T> items)

Parameters

items IEnumerable<T>

items to add

ApplySortCore(PropertyDescriptor, ListSortDirection)

Sorts the items (only when Sortable is true).

protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)

Parameters

prop PropertyDescriptor

property of the items to sort by

direction ListSortDirection

sort direction

OnComparison(object, object)

Compares two property values: as integers if both are integers, otherwise through IComparable, otherwise by their text.

protected virtual int OnComparison(object left, object right)

Parameters

left object

left item

right object

right item

Returns

int

less than zero if left precedes right, zero if they are equal, greater than zero if it follows

RemoveSortCore()

Removes any sort applied with ApplySortCore if sorting is implemented

protected override void RemoveSortCore()