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
Ttype of the items
- Inheritance
-
Collection<T>BindingList<T>ExBindingList<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- 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
listIList<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
IsSortedCore
Gets a value indicating whether the list is sorted.
protected override bool IsSortedCore { get; }
Property Value
SortDirectionCore
Gets the direction the list is sorted.
protected override ListSortDirection SortDirectionCore { get; }
Property Value
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
Sortable
Gets or sets whether collection is sortable.
public bool Sortable { get; set; }
Property Value
SupportsSortingCore
Gets a value indicating whether the list supports sorting.
protected override bool SupportsSortingCore { get; }
Property Value
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
itemsIEnumerable<T>items to add
ApplySortCore(PropertyDescriptor, ListSortDirection)
protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)
Parameters
propPropertyDescriptorproperty of the items to sort by
directionListSortDirectionsort 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
Returns
- int
less than zero if
leftprecedesright, 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()