New to Telerik UI for WinForms? Start a free 30-day trial

Manages the bound or unbound data source, current item/position and value formatting for a RadListElement.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class ListDataLayer : IDataItemSource, IDisposable

Inheritance: objectListDataLayer

Implements: IDataItemSourceIDisposable

Constructors

C#
public ListDataLayer(RadListElement owner)
Parameters:ownerRadListElement

Properties

Gets or sets the binding context used to resolve the bound data source's currency manager.

C#
public BindingContext BindingContext { get; }

Implements: IDataItemSource.BindingContext

Gets or sets whether adding a new item automatically makes it the current item.

C#
public bool ChangeCurrentOnAdd { get; set; }

Gets or sets the name of the boolean data source field bound to each item's checked state.

C#
public string CheckedMember { get; set; }

Gets or sets the item that is the current position in the underlying data view.

C#
public RadListDataItem CurrentItem { get; set; }

Gets or sets the index of the current item within the data view; -1 when no item is current.

C#
public int CurrentPosition { get; set; }

Gets or sets the name of the list or table within DataSource to bind to, when the data source contains multiple lists.

C#
public string DataMember { get; set; }

Gets or sets the object providing data for the list; setting it discards any cached value converter.

C#
public object DataSource { get; set; }

Gets the collection view that applies sorting, filtering and grouping to the list's items.

C#
public RadCollectionView<RadListDataItem> DataView { get; }

Gets or sets the name of the data source field used for an item's supplementary description text.

C#
public string DescriptionTextMember { get; set; }

Gets or sets the name of the data source field whose value is displayed for each item; changing it refreshes cached item text.

C#
public string DisplayMember { get; set; }

Gets the collection of items currently displayed by the list.

C#
public RadListDataItemCollection Items { get; }

Gets the underlying source that bridges the bound data source and the collection of RadListDataItem objects.

C#
public RadListSource<RadListDataItem> ListSource { get; }

Gets the list element that owns this data layer.

C#
public RadListElement Owner { get; }

Gets or sets the name of the data source field that supplies each item's underlying value (as opposed to its displayed text).

C#
public string ValueMember { get; set; }

Methods

C#
protected virtual void CollectionView_CurrentChanged(object sender, EventArgs e)
Parameters:senderobjecteEventArgs
C#
protected virtual void CollectionView_CurrentChanging(object sender, CancelEventArgs e)
Parameters:senderobjecteCancelEventArgs
C#
protected virtual RadListDataItemCollection CreateItemsCollection(RadListElement owner)
Parameters:ownerRadListElementReturns:

RadListDataItemCollection

C#
protected virtual ListControlListSource CreateListSource()
Returns:

ListControlListSource

Unwires internal event handlers and disposes the underlying list source.

C#
public void Dispose()

Implements: IDisposable.Dispose()

C#
public object GetDescriptionTextValue(RadListDataItem item)
Parameters:itemRadListDataItemReturns:

object

Gets the raw display-member value for the specified item from the bound data source, or the item's own value when unbound.

C#
public object GetDisplayValue(RadListDataItem item)
Parameters:itemRadListDataItemReturns:

object

Gets the item located at the specified position in the data view.

C#
public RadListDataItem GetItemAtIndex(int index)
Parameters:indexintReturns:

RadListDataItem

Gets the items between the specified positions, inclusive of both bounds.

C#
public List<RadListDataItem> GetItemRange(int startIndex, int endIndex)
Parameters:startIndexintendIndexintReturns:

List<RadListDataItem>

Gets the position of the specified item's underlying row within the data view.

C#
public int GetRowIndex(RadListDataItem item)
Parameters:itemRadListDataItemReturns:

int

Converts the item's display value to its string representation using the cached string converter.

C#
public string GetUnformattedValue(RadListDataItem item)
Parameters:itemRadListDataItemReturns:

string

Gets the value-member value for the specified item, used as the item's underlying value distinct from its display text.

C#
public object GetValue(RadListDataItem item)
Parameters:itemRadListDataItemReturns:

object

Gets the number of items currently passing the active filter.

C#
public int GetVisibleItemsCount()
Returns:

int

Performs one-time setup of the data layer after construction; raises Initialized.

C#
public void Initialize()

Implements: IDataItemSource.Initialize()

Creates a new, unattached data item compatible with this list's item type.

C#
public IDataItem NewItem()
Returns:

IDataItem

Implements: IDataItemSource.NewItem()

C#
protected virtual void OnCurrentPositionChanged(int newPosition)
Parameters:newPositionint
C#
protected virtual bool OnCurrentPositionChanging(int newPosition)
Parameters:newPositionintReturns:

bool

Forces the underlying data view to re-evaluate sorting, filtering and grouping.

C#
public void Refresh()
C#
protected virtual void UnwireEvents()
C#
protected virtual void WireEvents()

Events

Occurs after BindingContext has changed.

C#
public event EventHandler BindingContextChanged

Implements: IDataItemSource.BindingContextChanged

Occurs after CurrentPosition has changed.

C#
public event PositionChangedEventHandler CurrentPositionChanged

Occurs before CurrentPosition changes, allowing the change to be canceled.

C#
public event PositionChangingEventHandler CurrentPositionChanging

Occurs after the data layer has completed initialization.

C#
public event EventHandler Initialized