Class DataControl
Represents a control that provides common functionality for all Telerik WPF controls that represent data.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Data.dll
Syntax
public abstract class DataControl : Control, ISelectorInternal, INotifyPropertyChanged
Constructors
DataControl()
Fields
CanUserSelectProperty
Identifies the CanUserSelect dependency property.
Declaration
public static readonly DependencyProperty CanUserSelectProperty
Field Value
System.Windows.DependencyProperty
|
CurrentItemProperty
Identifies the CurrentItem dependency property.
Declaration
public static readonly DependencyProperty CurrentItemProperty
Field Value
System.Windows.DependencyProperty
|
IsSynchronizedWithCurrentItemProperty
Identifies the IsSynchronizedWithCurrentItem dependency property.
Declaration
public static readonly DependencyProperty IsSynchronizedWithCurrentItemProperty
Field Value
System.Windows.DependencyProperty
|
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
System.Windows.DependencyProperty
|
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
System.Windows.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
System.Boolean
|
CurrentItem
Gets the data item bound to the row that contains the current cell.
Declaration
public object CurrentItem { get; set; }
Property Value
System.Object
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
public Nullable<bool> IsSynchronizedWithCurrentItem { get; set; }
Property Value
System.Nullable<System.Boolean>
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
DataItemCollection
|
ItemsSource
Gets or sets a collection that is used to generate the content of the control.
Declaration
public object ItemsSource { get; set; }
Property Value
System.Object
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
System.Object
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
System.Collections.ObjectModel.ObservableCollection<System.Object>
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
System.Boolean
|
TableDefinition
Gets the TableDefinition object for the current record collection.
Declaration
public TableDefinition TableDefinition { get; }
Property Value
TableDefinition
|
Methods
CreateTableDefinition()
Creates the specific table definition for the DataControl.
Declaration
protected virtual TableDefinition CreateTableDefinition()
Returns
TableDefinition
The newly created TableDefinition. |
InitializeSelection()
Initializes the selection.
Declaration
protected virtual void InitializeSelection()
OnCanUserSelectChanged(Boolean, Boolean)
Called when property CanUserSelect changes.
Declaration
protected virtual void OnCanUserSelectChanged(bool oldValue, bool newValue)
Parameters
System.Boolean
oldValue
Old property value. |
System.Boolean
newValue
New property value. |
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
System.Object
sender
The sender. |
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
The System.Collections.Specialized.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
System.Object
sender
The sender. |
System.ComponentModel.PropertyChangedEventArgs
e
The System.ComponentModel.PropertyChangedEventArgs instance containing the event data. |
OnItemsSourceChanged(Object, Object)
Called when ItemsSource property has changed.
Declaration
protected virtual void OnItemsSourceChanged(object oldValue, object newValue)
Parameters
System.Object
oldValue
The old value. |
System.Object
newValue
The new value. |
OnPropertyChanged(String)
Called when a property changes.
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
System.String
propertyName
Name of the property. |
OnSelectedItemChanged(Object, Object)
Called when the selected item of the DataControl is changed.
Declaration
protected virtual void OnSelectedItemChanged(object oldItem, object newItem)
Parameters
System.Object
oldItem
|
System.Object
newItem
|
OnSelectionChanging(SelectionChangingEventArgs)
Raises the SelectionChangingEvent event.
Declaration
protected virtual void OnSelectionChanging(SelectionChangingEventArgs args)
Parameters
SelectionChangingEventArgs
args
The SelectionChangingEventArgs instance containing the event data. |
RaiseSelectionChangedEvent(SelectionChangeEventArgs)
Raises the selection changed event.
Declaration
protected virtual void RaiseSelectionChangedEvent(SelectionChangeEventArgs args)
Parameters
SelectionChangeEventArgs
args
The SelectionChangeEventArgs instance containing the event data. |
Rebind()
Rebinds the grid.
Declaration
public void Rebind()
SetIsCurrent(Object, Boolean)
Sets the current state for a container that wraps a given data item.
Declaration
protected abstract void SetIsCurrent(object item, bool isCurrent)
Parameters
System.Object
item
The data item. |
System.Boolean
isCurrent
If set to |
SetIsSelected(Object, Boolean)
Sets the selection state for a container that wraps a given data item.
Declaration
protected abstract void SetIsSelected(object item, bool isSelected)
Parameters
System.Object
item
The data item. |
System.Boolean
isSelected
If set to |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|
SelectionChanged
Occurs when the selected items have changed.
Declaration
public event EventHandler<SelectionChangeEventArgs> SelectionChanged
Event Type
System.EventHandler<SelectionChangeEventArgs>
|
SelectionChanging
Occurs when the selected items are about to change.
Declaration
public event EventHandler<SelectionChangingEventArgs> SelectionChanging
Event Type
System.EventHandler<SelectionChangingEventArgs>
|