Provides a data binding source that manages strongly-typed data item collections with full support for Windows Forms data binding, list manipulation, and change notifications.
Definition
Namespace:Telerik.WinControls.Data
Assembly:Telerik.WinControls.dll
Type Parameters:
TDataItem
The type of data items in the list, which must implement IDataItem.
Syntax:
public class RadListSource<TDataItem> : IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, INotifyCollectionChanged, INotifyPropertyChanged, ICurrencyManagerProvider, IDisposable where TDataItem : IDataItem
Inheritance: objectRadListSource<TDataItem>
Derived Classes:
Implements:
Constructors
public RadListSource()
public RadListSource(IDataItemSource source, RadCollectionView<TDataItem> collectionView)
Properties
public PropertyDescriptorCollection BoundProperties { get; }
CollectionView
RadCollectionView<TDataItem>
Gets the collection view.
public RadCollectionView<TDataItem> CollectionView { get; }
The collection view.
Gets or sets a value indicating whether each value setting should be encapsulaed in its own BeginEdit EndEditTransaction.
public bool CreateATransactionForEveryValueSetting { get; set; }
Current
TDataItem
Gets the current.
public TDataItem Current { get; }
The current.
Gets or sets the name of the list or table in the data source for which the RadListSource<TDataItem> is bound.
[Browsable(true)]
public string DataMember { get; set; }
Gets or sets the data source of the RadListSource<TDataItem>.
public object DataSource { get; set; }
Gets a value indicating whether this instance is data bound.
public bool IsDataBound { get; }
true if this instance is data bound; otherwise, false.
Gets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }
Implements:
Determines whether this instance is in a Begin/End update block.
public bool IsUpdating { get; }
Items
List<TDataItem>
protected List<TDataItem> Items { get; set; }
Gets or sets the position.
public int Position { get; set; }
The position.
this[int]
TDataItem
Gets or sets the item at the specified index.
public bool UseCaseSensitiveFieldNames { get; set; }
Methods
Adds an item to the ICollection<T>.
public void Add(TDataItem item)
The object to add to the ICollection<T>.
Exceptions:The ICollection<T> is read-only.
Adds the new.
public virtual TDataItem AddNew()
TDataItem
Adds the created item to ListSource.
public virtual TDataItem AddNew(TDataItem item)
TDataItem
Begins the update.
public void BeginUpdate()
Removes all items from the ICollection<T>.
protected virtual void ClearItems()
protected virtual void ClearItemsCore()
Determines whether the ICollection<T> contains a specific value.
public bool Contains(TDataItem item)
The object to locate in the ICollection<T>.
Returns:true if item is found in the ICollection<T>; otherwise, false.
public void CopyTo(TDataItem[] array, int arrayIndex)
The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in array at which copying begins.
array is null.
arrayIndex is less than 0.
array is multidimensional.
-or-
arrayIndex is equal to or greater than the length of array.
-or-
The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.
-or-
Type T cannot be cast automatically to the type of the destination array.
protected virtual RadCollectionView<TDataItem> CreateDefaultCollectionView()
RadCollectionView<TDataItem>
public void Dispose()
Implements:
Ends the update.
public void EndUpdate()
Ends the update.
public void EndUpdate(bool notifyUpdates)
if set to true [notify updates].
Returns an enumerator that iterates through the collection.
public IEnumerator<TDataItem> GetEnumerator()
IEnumerator<TDataItem>
A IEnumerator<T> that can be used to iterate through the collection.
Returns the PropertyDescriptorCollection that represents the properties on each item used to bind data.
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
An array of PropertyDescriptor objects to find in the collection as bindable. This can be null.
Returns:The PropertyDescriptorCollection that represents the properties on each item used to bind data.
Implements:
Returns the name of the list.
public string GetListName(PropertyDescriptor[] listAccessors)
An array of PropertyDescriptor objects, for which the list name is returned. This can be null.
Returns:The name of the list.
Implements:
Determines the index of a specific item in the IList<T>.
public int IndexOf(TDataItem item)
The object to locate in the IList<T>.
Returns:The index of item if found in the list; otherwise, -1.
protected virtual void InitializeBoundRow(TDataItem item, object dataBoundItem)
Inserts an item to the IList<T> at the specified index.
public void Insert(int index, TDataItem item)
The zero-based index at which item should be inserted.
The object to insert into the IList<T>.
Exceptions:index is not a valid index in the IList<T>.
The IList<T> is read-only.
Raises a CollectionChanged notification with action ItemChanged. Must be paired with the NotifyItemChanging method.
public void NotifyItemChanged(TDataItem item, string propertyName)
Raises a CollectionChanged notification with action ItemChanged. Must be paired with the NotifyItemChanging method.
public void NotifyItemChanged(TDataItem item)
Raises a CollectionChanged notification with action ItemChanging. Must be paired with the NotifyItemChanged method.
public void NotifyItemChanging(TDataItem item, string propertyName)
Raises a CollectionChanged notification with action ItemChanging. Must be paired with the NotifyItemChanged method.
public void NotifyItemChanging(TDataItem item)
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Raises the NotifyPropertyChanged event
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Raises the PropertyChanged event
protected virtual void OnNotifyPropertyChanged(string propertyName)
The name of the property
protected virtual void ProcessCurrencyManagerListChanged(object sender, ListChangedEventArgs e)
Refreshes this instance.
public virtual void Refresh()
Removes the first occurrence of a specific object from the ICollection<T>.
public bool Remove(TDataItem item)
The object to remove from the ICollection<T>.
Returns:true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.
The ICollection<T> is read-only.
Removes the IList<T> item at the specified index.
public void RemoveAt(int index)
The zero-based index of the item to remove.
Exceptions:index is not a valid index in the IList<T>.
The IList<T> is read-only.
Implements:
Resets this instance.
public virtual void Reset()
protected virtual void UnWireEvents()
protected virtual void WireEvents()
Events
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements:
public event EventHandler PositionChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChanged
Implements: