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

Represents a control that provides common functionality for all Telerik WPF controls that represent data.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Data.dll

Syntax:

C#
public abstract class DataControl : Control, INotifyPropertyChanged

Inheritance: objectDataControl

Derived Classes: BaseItemsControlRadCarousel

Implements: INotifyPropertyChanged

Constructors

Initializes a new instance of the DataControl class.

C#
protected DataControl()

Fields

CanUserSelectProperty

DependencyProperty

Identifies the CanUserSelect dependency property.

C#
public static readonly DependencyProperty CanUserSelectProperty

CurrentItemProperty

DependencyProperty

Identifies the CurrentItem dependency property.

C#
public static readonly DependencyProperty CurrentItemProperty

Identifies the IsSynchronizedWithCurrentItem dependency property.

C#
public static readonly DependencyProperty IsSynchronizedWithCurrentItemProperty

ItemsSourceProperty

DependencyProperty

Identifies the ItemsSource dependency property.

C#
public static readonly DependencyProperty ItemsSourceProperty

SelectedItemProperty

DependencyProperty

Identifies the SelectedItem dependency property.

C#
public static readonly DependencyProperty SelectedItemProperty

Identifies the SelectionChanged routed event.

C#
public static readonly RoutedEvent SelectionChangedEvent

Identifies the SelectionChanging routed event.

C#
public static readonly RoutedEvent SelectionChangingEvent

Properties

Gets or sets a value indicating whether the user can select rows.

C#
public bool CanUserSelect { get; set; }
Property Value:

true if user can select; otherwise, false.

Gets the data item bound to the row that contains the current cell.

C#
public object CurrentItem { get; set; }
Property Value:

The data item bound to the row that contains the current cell.

Gets or sets a value that indicates whether DataControl should keep the SelectedItem synchronized with its CurrentItem property.

C#
[TypeConverter(typeof(NullableBoolConverter))]
public bool? IsSynchronizedWithCurrentItem { get; set; }
Property Value:

True if the SelectedItem is always synchronized with the current item; false if the SelectedItem is never synchronized; null if the SelectedItem is synchronized with the current item only if a CollectionView is used.

Items is the collection of data that is used to generate the content of this control.

C#
public DataItemCollection Items { get; }

Gets or sets a collection that is used to generate the content of the control.

C#
public object ItemsSource { get; set; }
Property Value:

The collection that is used to generate the content of the control. The default is null.

Gets or sets the data item corresponding to the selected row.

C#
public object SelectedItem { get; set; }
Property Value:

The data item corresponding to the selected row.

If the SelectionMode property is set to Extended and multiple rows are selected, use the SelectedItems property to retrieve all selected items.

Gets a collection that contains the data items corresponding to the selected rows.

C#
public ObservableCollection<object> SelectedItems { get; }
Property Value:

A collection of the data items corresponding to the selected rows.

If the SelectionMode property is set to Single, the SelectedItems list will contain only the SelectedItem property value.

Gets a value indicating whether this instance handles selection events and participates in the selection mechanism.

C#
protected virtual bool ShouldHandleSelection { get; }
Property Value:

true if handles selection; otherwise, false.

Gets the TableDefinition object for the current record collection.

C#
public TableDefinition TableDefinition { get; }

Methods

Creates the specific table definition for the DataControl.

C#
protected virtual TableDefinition CreateTableDefinition()
Returns:

TableDefinition

The newly created TableDefinition.

Initializes the selection.

C#
protected virtual void InitializeSelection()

Called when property CanUserSelect changes.

C#
protected virtual void OnCanUserSelectChanged(bool oldValue, bool newValue)
Parameters:oldValuebool

Old property value.

newValuebool

New property value.

Called when the current item of the DataControl is changed.

C#
protected virtual void OnCurrentItemChanged()

Called when this.Items collection changes.

C#
protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters:senderobject

The sender.

eNotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs instance containing the event data.

Called when this.Items has a property changed.

C#
protected virtual void OnItemsPropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters:senderobject

The sender.

ePropertyChangedEventArgs

The PropertyChangedEventArgs instance containing the event data.

Called when ItemsSource property has changed.

C#
protected virtual void OnItemsSourceChanged(object oldValue, object newValue)
Parameters:oldValueobject

The old value.

newValueobject

The new value.

Called when a property changes.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

Name of the property.

Called when the selected item of the DataControl is changed.

C#
protected virtual void OnSelectedItemChanged(object oldItem, object newItem)
Parameters:oldItemobjectnewItemobject

Raises the SelectionChangingEvent event.

C#
protected virtual void OnSelectionChanging(SelectionChangingEventArgs args)
Parameters:argsSelectionChangingEventArgs

The SelectionChangingEventArgs instance containing the event data.

Raises the selection changed event.

C#
protected virtual void RaiseSelectionChangedEvent(SelectionChangeEventArgs args)
Parameters:argsSelectionChangeEventArgs

The SelectionChangeEventArgs instance containing the event data.

Rebinds the grid.

C#
public void Rebind()

Sets the current state for a container that wraps a given data item.

C#
protected abstract void SetIsCurrent(object item, bool isCurrent)
Parameters:itemobject

The data item.

isCurrentbool

If set to true container is current.

Sets the selection state for a container that wraps a given data item.

C#
protected abstract void SetIsSelected(object item, bool isSelected)
Parameters:itemobject

The data item.

isSelectedbool

If set to true container is selected.

Events

Occurs when a property value changes.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged

Occurs when the selected items have changed.

C#
public event EventHandler<SelectionChangeEventArgs> SelectionChanged

Occurs when the selected items are about to change.

C#
public event EventHandler<SelectionChangingEventArgs> SelectionChanging