ClassRadListSource<TDataItem>
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
RadListSource()
Declaration
public RadListSource()
RadListSource(IDataItemSource)
Declaration
public RadListSource(IDataItemSource source)
Parameters
source
RadListSource(IDataItemSource, RadCollectionView<TDataItem>)
Declaration
public RadListSource(IDataItemSource source, RadCollectionView<TDataItem> collectionView)
Parameters
source
collectionView
RadCollectionView<TDataItem>
Properties
BoundProperties
Declaration
public PropertyDescriptorCollection BoundProperties { get; }
Property Value
CollectionView
Gets the collection view.
Declaration
public RadCollectionView<TDataItem> CollectionView { get; }
Property Value
RadCollectionView<TDataItem>
The collection view.
CreateATransactionForEveryValueSetting
Gets or sets a value indicating whether each value setting should be encapsulaed in its own BeginEdit EndEditTransaction.
Declaration
public bool CreateATransactionForEveryValueSetting { get; set; }
Property Value
Current
Gets the current.
Declaration
public TDataItem Current { get; }
Property Value
TDataItem
The current.
DataMember
Gets or sets the name of the list or table in the data source for which the RadListSource<TDataItem> is bound.
Declaration
[Browsable(true)]
public string DataMember { get; set; }
Property Value
DataSource
Gets or sets the data source of the RadListSource<TDataItem>.
IsDataBound
Gets a value indicating whether this instance is data bound.
Declaration
public bool IsDataBound { get; }
Property Value
true if this instance is data bound; otherwise, false.
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
IsUpdating
Determines whether this instance is in a Begin/End update block.
Items
Declaration
protected List<TDataItem> Items { get; set; }
Property Value
List<TDataItem>
Position
Gets or sets the position.
UseCaseSensitiveFieldNames
Declaration
public bool UseCaseSensitiveFieldNames { get; set; }
Property Value
Methods
Add(TDataItem)
Adds an item to the ICollection<T>.
Declaration
public void Add(TDataItem item)
Parameters
item
TDataItem
The object to add to the ICollection<T>.
Exceptions
The ICollection<T> is read-only.
AddNew()
Adds the new.
Declaration
public virtual TDataItem AddNew()
Returns
TDataItem
AddNew(TDataItem)
Adds the created item to ListSource.
Declaration
public virtual TDataItem AddNew(TDataItem item)
Parameters
item
TDataItem
Returns
TDataItem
Clear()
Removes all items from the ICollection<T>.
Declaration
public void Clear()
Exceptions
The ICollection<T> is read-only.
Implements
ClearItems()
Declaration
protected virtual void ClearItems()
ClearItemsCore()
Declaration
protected virtual void ClearItemsCore()
Contains(TDataItem)
Determines whether the ICollection<T> contains a specific value.
Declaration
public bool Contains(TDataItem item)
Parameters
item
TDataItem
The object to locate in the ICollection<T>.
Returns
true if item is found in the ICollection<T>; otherwise, false.
CopyTo(TDataItem[], int)
Declaration
public void CopyTo(TDataItem[] array, int arrayIndex)
Parameters
array
TDataItem[]
The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
arrayIndex
The zero-based index in array at which copying begins.
Exceptions
array is null.
arrayIndex is less than 0.
<code class="paramref">array</code> 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.
CreateDefaultCollectionView()
Declaration
protected virtual RadCollectionView<TDataItem> CreateDefaultCollectionView()
Returns
RadCollectionView<TDataItem>
Dispose()
Declaration
public void Dispose()
Implements
EndUpdate(bool)
Ends the update.
Declaration
public void EndUpdate(bool notifyUpdates)
Parameters
notifyUpdates
if set to true [notify updates].
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<TDataItem> GetEnumerator()
Returns
IEnumerator<TDataItem>
A IEnumerator<T> that can be used to iterate through the collection.
GetItemProperties(PropertyDescriptor[])
Returns the PropertyDescriptorCollection that represents the properties on each item used to bind data.
Declaration
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
Parameters
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
GetListName(PropertyDescriptor[])
Returns the name of the list.
Declaration
public string GetListName(PropertyDescriptor[] listAccessors)
Parameters
listAccessors
An array of PropertyDescriptor objects, for which the list name is returned. This can be null.
Returns
The name of the list.
Implements
IndexOf(TDataItem)
Determines the index of a specific item in the IList<T>.
Declaration
public int IndexOf(TDataItem item)
Parameters
item
TDataItem
The object to locate in the IList<T>.
Returns
The index of item if found in the list; otherwise, -1.
InitializeBoundRow(TDataItem, object)
Declaration
protected virtual void InitializeBoundRow(TDataItem item, object dataBoundItem)
Parameters
item
TDataItem
dataBoundItem
Insert(int, TDataItem)
Inserts an item to the IList<T> at the specified index.
Declaration
public void Insert(int index, TDataItem item)
Parameters
index
The zero-based index at which item should be inserted.
item
TDataItem
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.
InsertItem(int, TDataItem)
Declaration
protected virtual void InsertItem(int index, TDataItem item)
Parameters
index
item
TDataItem
Move(int, int)
Moves the specified item.
NotifyItemChanged(TDataItem)
Raises a CollectionChanged notification with action ItemChanged. Must be paired with the NotifyItemChanging method.
Declaration
public void NotifyItemChanged(TDataItem item)
Parameters
item
TDataItem
NotifyItemChanged(TDataItem, string)
Raises a CollectionChanged notification with action ItemChanged. Must be paired with the NotifyItemChanging method.
Declaration
public void NotifyItemChanged(TDataItem item, string propertyName)
Parameters
item
TDataItem
propertyName
NotifyItemChanging(TDataItem)
Raises a CollectionChanged notification with action ItemChanging. Must be paired with the NotifyItemChanged method.
Declaration
public void NotifyItemChanging(TDataItem item)
Parameters
item
TDataItem
NotifyItemChanging(TDataItem, string)
Raises a CollectionChanged notification with action ItemChanging. Must be paired with the NotifyItemChanged method.
Declaration
public void NotifyItemChanging(TDataItem item, string propertyName)
Parameters
item
TDataItem
propertyName
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
Parameters
e
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Raises the NotifyPropertyChanged event
Declaration
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
OnNotifyPropertyChanged(string)
Raises the PropertyChanged event
Declaration
protected virtual void OnNotifyPropertyChanged(string propertyName)
Parameters
propertyName
The name of the property
ProcessCurrencyManagerListChanged(object, ListChangedEventArgs)
Declaration
protected virtual void ProcessCurrencyManagerListChanged(object sender, ListChangedEventArgs e)
Parameters
sender
e
Remove(TDataItem)
Removes the first occurrence of a specific object from the ICollection<T>.
Declaration
public bool Remove(TDataItem item)
Parameters
item
TDataItem
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>.
Exceptions
The ICollection<T> is read-only.
RemoveAt(int)
Removes the IList<T> item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
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
SetItem(int, TDataItem)
Declaration
protected virtual void SetItem(int index, TDataItem item)
Parameters
index
item
TDataItem
UnWireEvents()
Declaration
protected virtual void UnWireEvents()
WireEvents()
Declaration
protected virtual void WireEvents()
Events
CollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Value
Implements
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements