Class
BindingProviderBase<T>

Represents a base class for data binding providers that facilitate two-way data binding between scheduler items and external data sources, providing mapping capabilities and change tracking.

Definition

Namespace:Telerik.WinControls.UI.Scheduler

Assembly:Telerik.WinControls.Scheduler.dll

Type Parameters:

T

The type of scheduler item that implements IDataBoundItem.

Syntax:

cs-api-definition
public abstract class BindingProviderBase<T> : BindingSource, IComponent, IDisposable, IBindingListView, IBindingList, IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, ISupportInitializeNotification, ISupportInitialize, ICurrencyManagerProvider, ISchedulerProvider<T> where T : IDataBoundItem

Inheritance: objectMarshalByRefObjectComponentBindingSourceBindingProviderBase<T>

Derived Classes: SchedulerBindingDataSource.EventBindingProviderSchedulerBindingDataSource.ResourceBindingProvider

Implements: IBindingListIBindingListViewICancelAddNewICollectionIComponentICurrencyManagerProviderIDisposableIEnumerableIListISchedulerProvider<T>ISupportInitializeISupportInitializeNotificationITypedList

Inherited Members BindingSource.GetRelatedCurrencyManager(string)BindingSource.CancelEdit()BindingSource.Dispose(bool)BindingSource.EndEdit()BindingSource.Find(string, object)BindingSource.MoveFirst()BindingSource.MoveLast()BindingSource.MoveNext()BindingSource.MovePrevious()BindingSource.OnAddingNew(AddingNewEventArgs)BindingSource.OnBindingComplete(BindingCompleteEventArgs)BindingSource.OnCurrentChanged(EventArgs)BindingSource.OnCurrentItemChanged(EventArgs)BindingSource.OnDataError(BindingManagerDataErrorEventArgs)BindingSource.OnPositionChanged(EventArgs)BindingSource.RemoveCurrent()BindingSource.ResetAllowNew()BindingSource.ResetBindings(bool)BindingSource.ResetCurrentItem()BindingSource.ResetItem(int)BindingSource.ResumeBinding()BindingSource.SuspendBinding()BindingSource.GetEnumerator()BindingSource.CopyTo(Array, int)BindingSource.Add(object)BindingSource.Clear()BindingSource.Contains(object)BindingSource.IndexOf(object)BindingSource.Insert(int, object)BindingSource.Remove(object)BindingSource.RemoveAt(int)BindingSource.GetListName(PropertyDescriptor[])BindingSource.GetItemProperties(PropertyDescriptor[])BindingSource.AddNew()BindingSource.Find(PropertyDescriptor, object)BindingSource.RemoveSort()BindingSource.RemoveFilter()BindingSource.CurrencyManagerBindingSource.CurrentBindingSource.DataMemberBindingSource.DataSourceBindingSource.IsBindingSuspendedBindingSource.ListBindingSource.PositionBindingSource.RaiseListChangedEventsBindingSource.SortBindingSource.CountBindingSource.IsSynchronizedBindingSource.SyncRootBindingSource.this[int]BindingSource.IsFixedSizeBindingSource.IsReadOnlyBindingSource.AllowEditBindingSource.AllowNewBindingSource.AllowRemoveBindingSource.SupportsChangeNotificationBindingSource.SupportsSearchingBindingSource.SupportsSortingBindingSource.IsSortedBindingSource.FilterBindingSource.SupportsAdvancedSortingBindingSource.SupportsFilteringBindingSource.AddingNewBindingSource.BindingCompleteBindingSource.DataErrorBindingSource.DataSourceChangedBindingSource.DataMemberChangedBindingSource.CurrentChangedBindingSource.CurrentItemChangedBindingSource.ListChangedBindingSource.PositionChangedComponent.Dispose()Component.GetService(Type)Component.ToString()Component.CanRaiseEventsComponent.EventsComponent.SiteComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

BindingProviderBase(SchedulerBindingDataSource)

Initializes a new instance of the BindingProviderBase<T> class with the specified data source owner.

Declaration

cs-api-definition
protected BindingProviderBase(SchedulerBindingDataSource owner)

Parameters

owner

SchedulerBindingDataSource

The SchedulerBindingDataSource that owns this binding provider.

Fields

schedulerItems

Declaration

cs-api-definition
protected List<T> schedulerItems

Field Value

List<T>

Properties

Mapping

Gets or sets the mapping information that defines how properties of scheduler items correspond to properties in the data source, enabling bidirectional data binding.

Declaration

cs-api-definition
public virtual IMappingInfo Mapping { get; set; }

Property Value

IMappingInfo

Implements ISchedulerProvider<T>.Mapping

TrackDataSourceChanges

Gets or sets a value indicating whether changes to the underlying data source should be tracked and synchronized with scheduler items.

Declaration

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

Property Value

bool

Methods

CreateInstance()

When overridden in a derived class, creates a new instance of the specific scheduler item type.

Declaration

cs-api-definition
protected abstract T CreateInstance()

Returns

T

A new instance of type T.

Delete(T)

Deletes a scheduler item from the data source and removes it from the scheduler items collection.

Declaration

cs-api-definition
public virtual void Delete(T itemToDelete)

Parameters

itemToDelete

T

The scheduler item to delete from the data source.

Implements ISchedulerProvider<T>.Delete(T)

DeleteCore(T)

Performs the core deletion logic for removing a scheduler item from the data source.

Declaration

cs-api-definition
protected virtual void DeleteCore(T itemToDelete)

Parameters

itemToDelete

T

The scheduler item to delete.

FindDataSourceProperty(SchedulerMapping)

Finds a property descriptor in the data source properties collection that matches the specified mapping.

Declaration

cs-api-definition
protected PropertyDescriptor FindDataSourceProperty(SchedulerMapping mapping)

Parameters

mapping

SchedulerMapping

The scheduler mapping that defines the data source property to find.

Returns

PropertyDescriptor

The PropertyDescriptor for the data source property, or null if not found.

GetItems(Predicate<T>)

Retrieves scheduler items from the data source, optionally applying a filter function.

Declaration

cs-api-definition
public IEnumerable<T> GetItems(Predicate<T> filterFunction)

Parameters

filterFunction

Predicate<T>

An optional filter function to apply when retrieving items. If null, all items are returned.

Returns

IEnumerable<T>

An enumerable collection of scheduler items of type T.

Implements ISchedulerProvider<T>.GetItems(Predicate<T>)

GetSourcePropertyName(PropertyDescriptor)

Gets the name of a data source property, allowing for custom property name transformations. Override this method to implement custom property naming strategies.

Declaration

cs-api-definition
protected virtual string GetSourcePropertyName(PropertyDescriptor property)

Parameters

property

PropertyDescriptor

The property descriptor for which to get the name.

Returns

string

The name to use for the property in data binding operations.

Insert(T)

Inserts a new scheduler item into the data source and synchronizes the change with the underlying data store.

Declaration

cs-api-definition
public virtual void Insert(T itemToInsert)

Parameters

itemToInsert

T

The scheduler item to insert into the data source.

Implements ISchedulerProvider<T>.Insert(T)

InsertCore(T)

Performs the core insertion logic for adding a scheduler item to the data source.

Declaration

cs-api-definition
protected virtual void InsertCore(T itemToInsert)

Parameters

itemToInsert

T

The scheduler item to insert.

OnCreateSchedulerItemsBegin(PropertyDescriptorCollection)

Called before the process of extracting scheduler items from the data source begins. Override this method to perform initialization or preparation tasks.

Declaration

cs-api-definition
protected virtual void OnCreateSchedulerItemsBegin(PropertyDescriptorCollection properties)

Parameters

properties

PropertyDescriptorCollection

The collection of properties available on the data source items.

OnCreateSchedulerItemsEnd()

Called after the process of extracting scheduler items from the data source completes. Override this method to perform cleanup or finalization tasks.

Declaration

cs-api-definition
protected virtual void OnCreateSchedulerItemsEnd()

OnDataMemberChanged(EventArgs)

Raises the DataMemberChanged event and updates the data properties cache.

Declaration

cs-api-definition
protected override void OnDataMemberChanged(EventArgs e)

Parameters

e

EventArgs

An EventArgs that contains the event data.

Overrides BindingSource.OnDataMemberChanged(EventArgs)

OnDataSourceChanged(EventArgs)

Raises the DataSourceChanged event and updates the data properties cache.

Declaration

cs-api-definition
protected override void OnDataSourceChanged(EventArgs e)

Parameters

e

EventArgs

An EventArgs that contains the event data.

Overrides BindingSource.OnDataSourceChanged(EventArgs)

OnItemsChanged(ListChangedEventArgs<T>)

Raises the ItemsChanged event to notify subscribers of changes to the scheduler items collection.

Declaration

cs-api-definition
protected virtual void OnItemsChanged(ListChangedEventArgs<T> args)

Parameters

args

ListChangedEventArgs<T>

The ListChangedEventArgs<T> instance containing the event data.

OnListChanged(ListChangedEventArgs)

Raises the ListChanged event and handles synchronization between the data source and scheduler items.

Declaration

cs-api-definition
protected override void OnListChanged(ListChangedEventArgs e)

Parameters

e

ListChangedEventArgs

A ListChangedEventArgs that contains the event data.

Overrides BindingSource.OnListChanged(ListChangedEventArgs)

ProcessDataSourceValue(T, SchedulerMapping, object)

Called to process a value from the data source when the corresponding scheduler item property cannot be found or when custom processing is required. Override this method to handle complex mappings.

Declaration

cs-api-definition
protected virtual void ProcessDataSourceValue(T schedulerItem, SchedulerMapping mapping, object value)

Parameters

schedulerItem

T

The scheduler item being populated.

mapping

SchedulerMapping

The mapping configuration for the current property.

value

object

The value from the data source that needs processing.

ProcessSchedulerItem(T, object, SchedulerMapping, PropertyDescriptor)

Called to process a scheduler item value when updating the data source and custom processing is required. Override this method to handle complex mappings during data source updates.

Declaration

cs-api-definition
protected virtual void ProcessSchedulerItem(T schedulerItem, object dataSourceItem, SchedulerMapping mapping, PropertyDescriptor dataItemProperty)

Parameters

schedulerItem

T

The scheduler item containing the source value.

dataSourceItem

object

The data source item being updated.

mapping

SchedulerMapping

The mapping configuration for the current property.

dataItemProperty

PropertyDescriptor

The property descriptor for the data source property being updated.

ReadSchedulerItem(T, object)

Populates a scheduler item with data from the corresponding data source item using the configured property mappings.

Declaration

cs-api-definition
protected virtual void ReadSchedulerItem(T schedulerItem, object item)

Parameters

schedulerItem

T

The scheduler item to populate with data.

item

object

The data source item containing the source data.

ShouldApplyMapping(SchedulerMapping)

Determines whether a specific mapping should be applied during data binding operations. Override this method to implement conditional mapping logic.

Declaration

cs-api-definition
protected virtual bool ShouldApplyMapping(SchedulerMapping mapping)

Parameters

mapping

SchedulerMapping

The scheduler mapping to evaluate.

Returns

bool

true if the mapping should be applied; otherwise, false.

ShouldReadDataItem(object)

Determines whether a specific data source item should be processed and converted to a scheduler item. Override this method to implement custom filtering logic during data source enumeration.

Declaration

cs-api-definition
protected virtual bool ShouldReadDataItem(object item)

Parameters

item

object

The data source item to evaluate.

Returns

bool

true if the item should be processed; otherwise, false.

Update(T, string)

Updates an existing scheduler item in the data source with new property values.

Declaration

cs-api-definition
public virtual void Update(T itemToUpdate, string propertyName)

Parameters

itemToUpdate

T

The scheduler item to update in the data source.

propertyName

string

The name of the specific property that changed, or null/empty to update all properties.

Implements ISchedulerProvider<T>.Update(T, string)

UpdateChildItems()

Updates any child or related items after a modification operation. Override this method to provide custom child item synchronization logic.

Declaration

cs-api-definition
protected virtual void UpdateChildItems()

UpdateCore(T, string)

Performs the core update logic for modifying a scheduler item in the data source.

Declaration

cs-api-definition
protected virtual void UpdateCore(T itemToUpdate, string propertyName)

Parameters

itemToUpdate

T

The scheduler item to update.

propertyName

string

The name of the specific property that changed, or null/empty to update all properties.

UpdateDataItem(T, object, string)

Updates the properties of a data source item with values from the corresponding scheduler item.

Declaration

cs-api-definition
protected void UpdateDataItem(T itemToUpdate, object dataItem, string propertyName)

Parameters

itemToUpdate

T

The scheduler item containing the source values.

dataItem

object

The data source item to update.

propertyName

string

The name of the specific property to update, or null/empty to update all properties.

UpdateDataItemProperties(object, T)

Updates all mapped properties of a data source item with values from the corresponding scheduler item.

Declaration

cs-api-definition
protected virtual void UpdateDataItemProperties(object item, T schedulerItem)

Parameters

item

object

The data source item to update.

schedulerItem

T

The scheduler item containing the source values.

UpdateDataItemProperty(object, T, SchedulerMapping)

Updates a specific property of a data source item with the corresponding value from a scheduler item using the provided mapping.

Declaration

cs-api-definition
protected virtual bool UpdateDataItemProperty(object item, T schedulerItem, SchedulerMapping mapping)

Parameters

item

object

The data source item to update.

schedulerItem

T

The scheduler item containing the source value.

mapping

SchedulerMapping

The mapping configuration that defines the property relationship.

Returns

bool

true if the property was successfully updated; otherwise, false.

UpdateDataPropertiesCache()

Updates the cached collection of data source property descriptors based on the current data list.

Declaration

cs-api-definition
protected void UpdateDataPropertiesCache()

UpdateSchedulerPropertiesCache()

Updates the cached collection of scheduler item property descriptors based on the current scheduler item type.

Declaration

cs-api-definition
protected void UpdateSchedulerPropertiesCache()

Events

ItemsChanged

Occurs when the scheduler items collection changes due to data source modifications.

Declaration

cs-api-definition
public event EventHandler<ListChangedEventArgs<T>> ItemsChanged

Event Value

EventHandler<ListChangedEventArgs<T>>

Implements ISchedulerProvider<T>.ItemsChanged