ClassDataControl
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
DataControl()
Initializes a new instance of the DataControl class.
Declaration
protected DataControl()
Fields
CanUserSelectProperty
Identifies the CanUserSelect dependency property.
Declaration
public static readonly DependencyProperty CanUserSelectProperty
Field Value
DependencyProperty
CurrentItemProperty
Identifies the CurrentItem dependency property.
Declaration
public static readonly DependencyProperty CurrentItemProperty
Field Value
DependencyProperty
IsSynchronizedWithCurrentItemProperty
Identifies the IsSynchronizedWithCurrentItem dependency property.
Declaration
public static readonly DependencyProperty IsSynchronizedWithCurrentItemProperty
Field Value
DependencyProperty
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
DependencyProperty
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
DependencyProperty
SelectionChangedEvent
Identifies the SelectionChanged routed event.
Declaration
public static readonly RoutedEvent SelectionChangedEvent
Field Value
RoutedEvent
SelectionChangingEvent
Identifies the SelectionChanging routed event.
Declaration
public static readonly RoutedEvent SelectionChangingEvent
Field Value
RoutedEvent
Properties
CanUserSelect
Gets or sets a value indicating whether the user can select rows.
Declaration
public bool CanUserSelect { get; set; }
Property Value
true if user can select; otherwise, false.
CurrentItem
Gets the data item bound to the row that contains the current cell.
Declaration
public object CurrentItem { get; set; }
Property Value
The data item bound to the row that contains the current cell.
IsSynchronizedWithCurrentItem
Gets or sets a value that indicates whether DataControl should keep the SelectedItem synchronized with its CurrentItem property.
Declaration
[TypeConverter(typeof(NullableBoolConverter))]
public bool? IsSynchronizedWithCurrentItem { get; set; }
Property Value
bool?
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
Items is the collection of data that is used to generate the content of this control.
Declaration
public DataItemCollection Items { get; }
Property Value
ItemsSource
Gets or sets a collection that is used to generate the content of the control.
Declaration
public object ItemsSource { get; set; }
Property Value
The collection that is used to generate the content of the control. The default is null.
SelectedItem
Gets or sets the data item corresponding to the selected row.
Declaration
public object SelectedItem { get; set; }
Property Value
The data item corresponding to the selected row.
Remarks
If the SelectionMode property is set to Extended and multiple rows are selected, use the SelectedItems property to retrieve all selected items.
SelectedItems
Gets a collection that contains the data items corresponding to the selected rows.
Declaration
public ObservableCollection<object> SelectedItems { get; }
Property Value
A collection of the data items corresponding to the selected rows.
Remarks
If the SelectionMode property is set to Single, the SelectedItems list will contain only the SelectedItem property value.
ShouldHandleSelection
Gets a value indicating whether this instance handles selection events and participates in the selection mechanism.
Declaration
protected virtual bool ShouldHandleSelection { get; }
Property Value
true if handles selection; otherwise, false.
TableDefinition
Gets the TableDefinition object for the current record collection.
Declaration
public TableDefinition TableDefinition { get; }
Property Value
Methods
CreateTableDefinition()
Creates the specific table definition for the DataControl.
Declaration
protected virtual TableDefinition CreateTableDefinition()
Returns
The newly created TableDefinition.
InitializeSelection()
Initializes the selection.
Declaration
protected virtual void InitializeSelection()
OnCanUserSelectChanged(bool, bool)
Called when property CanUserSelect changes.
OnCurrentItemChanged()
Called when the current item of the DataControl is changed.
Declaration
protected virtual void OnCurrentItemChanged()
OnItemsCollectionChanged(object, NotifyCollectionChangedEventArgs)
Called when this.Items collection changes.
Declaration
protected virtual void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters
sender
The sender.
e
NotifyCollectionChangedEventArgs
The NotifyCollectionChangedEventArgs instance containing the event data.
OnItemsPropertyChanged(object, PropertyChangedEventArgs)
Called when this.Items has a property changed.
Declaration
protected virtual void OnItemsPropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
sender
The sender.
e
The PropertyChangedEventArgs instance containing the event data.
OnItemsSourceChanged(object, object)
Called when ItemsSource property has changed.
OnPropertyChanged(string)
Called when a property changes.
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyName
Name of the property.
OnSelectedItemChanged(object, object)
Called when the selected item of the DataControl is changed.
OnSelectionChanging(SelectionChangingEventArgs)
Raises the SelectionChangingEvent event.
Declaration
protected virtual void OnSelectionChanging(SelectionChangingEventArgs args)
Parameters
args
The SelectionChangingEventArgs instance containing the event data.
RaiseSelectionChangedEvent(SelectionChangeEventArgs)
Raises the selection changed event.
Declaration
protected virtual void RaiseSelectionChangedEvent(SelectionChangeEventArgs args)
Parameters
args
The SelectionChangeEventArgs instance containing the event data.
SetIsCurrent(object, bool)
Sets the current state for a container that wraps a given data item.
SetIsSelected(object, bool)
Sets the selection state for a container that wraps a given data item.
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements
SelectionChanged
Occurs when the selected items have changed.
Declaration
public event EventHandler<SelectionChangeEventArgs> SelectionChanged
Event Value
SelectionChanging
Occurs when the selected items are about to change.
Declaration
public event EventHandler<SelectionChangingEventArgs> SelectionChanging
Event Value