Class
RadListSource<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:

cs-api-definition
public class RadListSource<TDataItem> : IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, INotifyCollectionChanged, INotifyPropertyChanged, ICurrencyManagerProvider, IDisposable where TDataItem : IDataItem

Inheritance: objectRadListSource<TDataItem>

Derived Classes: GridViewListSourceListControlListSourceListViewListSourceTreeMapListSource

Implements: ICancelAddNewICollectionICurrencyManagerProviderIDisposableIEnumerableIListINotifyCollectionChangedINotifyPropertyChangedITypedList

Constructors

RadListSource()

Declaration

cs-api-definition
public RadListSource()

RadListSource(IDataItemSource)

Declaration

cs-api-definition
public RadListSource(IDataItemSource source)

Parameters

source

IDataItemSource

RadListSource(IDataItemSource, RadCollectionView<TDataItem>)

Declaration

cs-api-definition
public RadListSource(IDataItemSource source, RadCollectionView<TDataItem> collectionView)

Parameters

source

IDataItemSource

collectionView

RadCollectionView<TDataItem>

Properties

BoundProperties

Declaration

cs-api-definition
public PropertyDescriptorCollection BoundProperties { get; }

Property Value

PropertyDescriptorCollection

CollectionView

Gets the collection view.

Declaration

cs-api-definition
public RadCollectionView<TDataItem> CollectionView { get; }

Property Value

RadCollectionView<TDataItem>

The collection view.

Count

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

Implements ICollection.Count

CreateATransactionForEveryValueSetting

Gets or sets a value indicating whether each value setting should be encapsulaed in its own BeginEdit EndEditTransaction.

Declaration

cs-api-definition
public bool CreateATransactionForEveryValueSetting { get; set; }

Property Value

bool

Current

Gets the current.

Declaration

cs-api-definition
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

cs-api-definition
[Browsable(true)]
public string DataMember { get; set; }

Property Value

string

DataSource

Gets or sets the data source of the RadListSource<TDataItem>.

Declaration

cs-api-definition
public object DataSource { get; set; }

Property Value

object

IsDataBound

Gets a value indicating whether this instance is data bound.

Declaration

cs-api-definition
public bool IsDataBound { get; }

Property Value

bool

true if this instance is data bound; otherwise, false.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

Implements IList.IsReadOnly

IsUpdating

Determines whether this instance is in a Begin/End update block.

Declaration

cs-api-definition
public bool IsUpdating { get; }

Property Value

bool

Items

Declaration

cs-api-definition
protected List<TDataItem> Items { get; set; }

Property Value

List<TDataItem>

Position

Gets or sets the position.

Declaration

cs-api-definition
public int Position { get; set; }

Property Value

int

The position.

UseCaseSensitiveFieldNames

Declaration

cs-api-definition
public bool UseCaseSensitiveFieldNames { get; set; }

Property Value

bool

this[int]

Gets or sets the item at the specified index.

Declaration

cs-api-definition
public TDataItem this[int index] { get; set; }

Parameters

index

int

Property Value

TDataItem

Methods

Add(TDataItem)

Adds an item to the ICollection<T>.

Declaration

cs-api-definition
public void Add(TDataItem item)

Parameters

item

TDataItem

The object to add to the ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

AddNew()

Adds the new.

Declaration

cs-api-definition
public virtual TDataItem AddNew()

Returns

TDataItem

AddNew(TDataItem)

Adds the created item to ListSource.

Declaration

cs-api-definition
public virtual TDataItem AddNew(TDataItem item)

Parameters

item

TDataItem

Returns

TDataItem

BeginUpdate()

Begins the update.

Declaration

cs-api-definition
public void BeginUpdate()

ChangeItem(int, TDataItem, string)

Declaration

cs-api-definition
protected virtual void ChangeItem(int index, TDataItem item, string propertyName)

Parameters

index

int

item

TDataItem

propertyName

string

Clear()

Removes all items from the ICollection<T>.

Declaration

cs-api-definition
public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Implements IList.Clear()

ClearItems()

Declaration

cs-api-definition
protected virtual void ClearItems()

ClearItemsCore()

Declaration

cs-api-definition
protected virtual void ClearItemsCore()

Contains(TDataItem)

Determines whether the ICollection<T> contains a specific value.

Declaration

cs-api-definition
public bool Contains(TDataItem item)

Parameters

item

TDataItem

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(TDataItem[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

Declaration

cs-api-definition
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

int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

<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

cs-api-definition
protected virtual RadCollectionView<TDataItem> CreateDefaultCollectionView()

Returns

RadCollectionView<TDataItem>

Dispose()

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

EndUpdate()

Ends the update.

Declaration

cs-api-definition
public void EndUpdate()

EndUpdate(bool)

Ends the update.

Declaration

cs-api-definition
public void EndUpdate(bool notifyUpdates)

Parameters

notifyUpdates

bool

if set to true [notify updates].

GetBoundValue(object, string)

Declaration

cs-api-definition
public object GetBoundValue(object dataBoundItem, string propertyName)

Parameters

dataBoundItem

object

propertyName

string

Returns

object

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration

cs-api-definition
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

cs-api-definition
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)

Parameters

listAccessors

PropertyDescriptor[]

An array of PropertyDescriptor objects to find in the collection as bindable. This can be null.

Returns

PropertyDescriptorCollection

The PropertyDescriptorCollection that represents the properties on each item used to bind data.

Implements ITypedList.GetItemProperties(PropertyDescriptor[])

GetListName(PropertyDescriptor[])

Returns the name of the list.

Declaration

cs-api-definition
public string GetListName(PropertyDescriptor[] listAccessors)

Parameters

listAccessors

PropertyDescriptor[]

An array of PropertyDescriptor objects, for which the list name is returned. This can be null.

Returns

string

The name of the list.

Implements ITypedList.GetListName(PropertyDescriptor[])

IndexOf(TDataItem)

Determines the index of a specific item in the IList<T>.

Declaration

cs-api-definition
public int IndexOf(TDataItem item)

Parameters

item

TDataItem

The object to locate in the IList<T>.

Returns

int

The index of item if found in the list; otherwise, -1.

InitializeBoundRow(TDataItem, object)

Declaration

cs-api-definition
protected virtual void InitializeBoundRow(TDataItem item, object dataBoundItem)

Parameters

item

TDataItem

dataBoundItem

object

Insert(int, TDataItem)

Inserts an item to the IList<T> at the specified index.

Declaration

cs-api-definition
public void Insert(int index, TDataItem item)

Parameters

index

int

The zero-based index at which item should be inserted.

item

TDataItem

The object to insert into the IList<T>.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

InsertItem(int, TDataItem)

Declaration

cs-api-definition
protected virtual void InsertItem(int index, TDataItem item)

Parameters

index

int

item

TDataItem

Move(int, int)

Moves the specified item.

Declaration

cs-api-definition
public void Move(int oldIndex, int newIndex)

Parameters

oldIndex

int

The old index.

newIndex

int

The new index.

MoveItem(int, int)

Declaration

cs-api-definition
protected virtual void MoveItem(int oldIndex, int newIndex)

Parameters

oldIndex

int

newIndex

int

NotifyItemChanged(TDataItem)

Raises a CollectionChanged notification with action ItemChanged. Must be paired with the NotifyItemChanging method.

Declaration

cs-api-definition
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

cs-api-definition
public void NotifyItemChanged(TDataItem item, string propertyName)

Parameters

item

TDataItem

propertyName

string

NotifyItemChanging(TDataItem)

Raises a CollectionChanged notification with action ItemChanging. Must be paired with the NotifyItemChanged method.

Declaration

cs-api-definition
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

cs-api-definition
public void NotifyItemChanging(TDataItem item, string propertyName)

Parameters

item

TDataItem

propertyName

string

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Declaration

cs-api-definition
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e

NotifyCollectionChangedEventArgs

OnNotifyPropertyChanged(PropertyChangedEventArgs)

Raises the NotifyPropertyChanged event

Declaration

cs-api-definition
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)

Parameters

e

PropertyChangedEventArgs

OnNotifyPropertyChanged(string)

Raises the PropertyChanged event

Declaration

cs-api-definition
protected virtual void OnNotifyPropertyChanged(string propertyName)

Parameters

propertyName

string

The name of the property

ProcessCurrencyManagerListChanged(object, ListChangedEventArgs)

Declaration

cs-api-definition
protected virtual void ProcessCurrencyManagerListChanged(object sender, ListChangedEventArgs e)

Parameters

sender

object

e

ListChangedEventArgs

Refresh()

Refreshes this instance.

Declaration

cs-api-definition
public virtual void Refresh()

Remove(TDataItem)

Removes the first occurrence of a specific object from the ICollection<T>.

Declaration

cs-api-definition
public bool Remove(TDataItem item)

Parameters

item

TDataItem

The object to remove from the ICollection<T>.

Returns

bool

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

NotSupportedException

The ICollection<T> is read-only.

RemoveAt(int)

Removes the IList<T> item at the specified index.

Declaration

cs-api-definition
public void RemoveAt(int index)

Parameters

index

int

The zero-based index of the item to remove.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Implements IList.RemoveAt(int)

RemoveItem(int)

Declaration

cs-api-definition
protected virtual void RemoveItem(int index)

Parameters

index

int

Reset()

Resets this instance.

Declaration

cs-api-definition
public virtual void Reset()

SetBoundValue(IDataItem, string, object)

Declaration

cs-api-definition
public bool SetBoundValue(IDataItem dataItem, string propertyName, object value)

Parameters

dataItem

IDataItem

propertyName

string

value

object

Returns

bool

SetBoundValue(IDataItem, string, object, string)

Declaration

cs-api-definition
public bool SetBoundValue(IDataItem dataItem, string propertyName, object value, string path)

Parameters

dataItem

IDataItem

propertyName

string

value

object

path

string

Returns

bool

SetBoundValue(IDataItem, string, string, object, string)

Declaration

cs-api-definition
public bool SetBoundValue(IDataItem dataItem, string propertyName, string columnName, object value, string path)

Parameters

dataItem

IDataItem

propertyName

string

columnName

string

value

object

path

string

Returns

bool

SetItem(int, TDataItem)

Declaration

cs-api-definition
protected virtual void SetItem(int index, TDataItem item)

Parameters

index

int

item

TDataItem

UnWireEvents()

Declaration

cs-api-definition
protected virtual void UnWireEvents()

WireEvents()

Declaration

cs-api-definition
protected virtual void WireEvents()

Events

CollectionChanged

Occurs when the collection changes.

Declaration

cs-api-definition
public event NotifyCollectionChangedEventHandler CollectionChanged

Event Value

NotifyCollectionChangedEventHandler

Implements INotifyCollectionChanged.CollectionChanged

PositionChanged

Declaration

cs-api-definition
public event EventHandler PositionChanged

Event Value

EventHandler

PropertyChanged

Occurs when a property value changes.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged