DataControl
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:
public abstract class DataControl : Control, INotifyPropertyChanged
Inheritance: objectDataControl
Derived Classes:
Implements:
Constructors
Initializes a new instance of the DataControl class.
protected DataControl()
Fields
CanUserSelectProperty
DependencyProperty
Identifies the CanUserSelect dependency property.
public static readonly DependencyProperty CanUserSelectProperty
CurrentItemProperty
DependencyProperty
Identifies the CurrentItem dependency property.
public static readonly DependencyProperty CurrentItemProperty
IsSynchronizedWithCurrentItemProperty
DependencyProperty
Identifies the IsSynchronizedWithCurrentItem dependency property.
public static readonly DependencyProperty IsSynchronizedWithCurrentItemProperty
ItemsSourceProperty
DependencyProperty
Identifies the ItemsSource dependency property.
public static readonly DependencyProperty ItemsSourceProperty
SelectedItemProperty
DependencyProperty
Identifies the SelectedItem dependency property.
public static readonly DependencyProperty SelectedItemProperty
SelectionChangedEvent
RoutedEvent
Identifies the SelectionChanged routed event.
public static readonly RoutedEvent SelectionChangedEvent
SelectionChangingEvent
RoutedEvent
Identifies the SelectionChanging routed event.
public static readonly RoutedEvent SelectionChangingEvent
Properties
Gets or sets a value indicating whether the user can select rows.
public bool CanUserSelect { get; set; }
true if user can select; otherwise, false.
Gets the data item bound to the row that contains the current cell.
public object CurrentItem { get; set; }
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.
[TypeConverter(typeof(NullableBoolConverter))]
public bool? IsSynchronizedWithCurrentItem { get; set; }
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.
public DataItemCollection Items { get; }
Gets or sets a collection that is used to generate the content of the control.
public object ItemsSource { get; set; }
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.
public object SelectedItem { get; set; }
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.
public ObservableCollection<object> SelectedItems { get; }
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.
protected virtual bool ShouldHandleSelection { get; }
true if handles selection; otherwise, false.
Gets the TableDefinition object for the current record collection.
public TableDefinition TableDefinition { get; }
Methods
Creates the specific table definition for the DataControl.
protected virtual TableDefinition CreateTableDefinition()
The newly created TableDefinition.
Initializes the selection.
protected virtual void InitializeSelection()
Called when the current item of the DataControl is changed.
protected virtual void OnCurrentItemChanged()
Called when this.Items collection changes.
protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
The sender.
eNotifyCollectionChangedEventArgsThe NotifyCollectionChangedEventArgs instance containing the event data.
Called when this.Items has a property changed.
protected virtual void OnItemsPropertyChanged(object sender, PropertyChangedEventArgs e)
The sender.
ePropertyChangedEventArgsThe PropertyChangedEventArgs instance containing the event data.
Called when a property changes.
protected virtual void OnPropertyChanged(string propertyName)
Name of the property.
Called when the selected item of the DataControl is changed.
Raises the SelectionChangingEvent event.
protected virtual void OnSelectionChanging(SelectionChangingEventArgs args)
The SelectionChangingEventArgs instance containing the event data.
Raises the selection changed event.
protected virtual void RaiseSelectionChangedEvent(SelectionChangeEventArgs args)
The SelectionChangeEventArgs instance containing the event data.
Rebinds the grid.
public void Rebind()
Events
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChanged
Implements:
Occurs when the selected items have changed.
public event EventHandler<SelectionChangeEventArgs> SelectionChanged
Occurs when the selected items are about to change.
public event EventHandler<SelectionChangingEventArgs> SelectionChanging