RadTreeViewItem
Represents an item in the RadTreeView control.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Navigation.dll
Syntax:
[TelerikToolboxCategory("Navigation")]
public class RadTreeViewItem : EditableHeaderedItemsControl, ICommandSource
Inheritance: objectEditableHeaderedItemsControlRadTreeViewItem
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadTreeViewItem class.
public RadTreeViewItem()
Fields
CheckedEvent
RoutedEvent
Identifies the Checked routed event.
public static readonly RoutedEvent CheckedEvent
CheckStateProperty
DependencyProperty
Identifies the CheckState dependency property.
public static readonly DependencyProperty CheckStateProperty
ClickEvent
RoutedEvent
Identifies the Click routed event.
public static readonly RoutedEvent ClickEvent
CollapsedEvent
RoutedEvent
Identifies the Collapsed routed event.
public static readonly RoutedEvent CollapsedEvent
CommandExecutionTriggerProperty
DependencyProperty
Identifies the CommandExecutionTrigger dependency property.
public static readonly DependencyProperty CommandExecutionTriggerProperty
CommandParameterProperty
DependencyProperty
Identifies the CommandParameter dependency property.
public static readonly DependencyProperty CommandParameterProperty
CommandProperty
DependencyProperty
Identifies the ClickCommand dependency property.
public static readonly DependencyProperty CommandProperty
CommandTargetProperty
DependencyProperty
Identifies the CommandTarget dependency property.
public static readonly DependencyProperty CommandTargetProperty
DefaultImageSrcProperty
DependencyProperty
Identifies the DefaultImageSrc dependency property.
public static readonly DependencyProperty DefaultImageSrcProperty
DoubleClickEvent
RoutedEvent
Identifies the DoubleClick routed event.
public static readonly RoutedEvent DoubleClickEvent
DropPositionProperty
DependencyProperty
Identifies the DropPosition property.
public static readonly DependencyProperty DropPositionProperty
ExpandedEvent
RoutedEvent
Identifies the Expanded routed event.
public static readonly RoutedEvent ExpandedEvent
ExpandedImageSrcProperty
DependencyProperty
Identifies the ExpandedImageSrc dependency property.
public static readonly DependencyProperty ExpandedImageSrcProperty
ExpanderButtonMinWidthProperty
DependencyProperty
Identifies the ExpanderButtonMinWidth dependency property.
public static readonly DependencyProperty ExpanderButtonMinWidthProperty
ExpanderStyleProperty
DependencyProperty
Identifies the ExpanderStyle dependency property.
public static readonly DependencyProperty ExpanderStyleProperty
IsCheckBoxEnabledProperty
DependencyProperty
Identifies the IsCheckBoxEnabled dependency property.
public static readonly DependencyProperty IsCheckBoxEnabledProperty
IsCheckedProperty
DependencyProperty
Identifies the IsChecked property.
public static readonly DependencyProperty IsCheckedProperty
IsDragOverProperty
DependencyProperty
Identifies the IsDragOver property.
public static readonly DependencyProperty IsDragOverProperty
IsDropAllowedProperty
DependencyProperty
Identifies the IsDropAllowed dependency property.
public static readonly DependencyProperty IsDropAllowedProperty
IsExpandedProperty
DependencyProperty
Identifies the IsExpanded dependency property.
public static readonly DependencyProperty IsExpandedProperty
IsLoadingOnDemandProperty
DependencyProperty
Identifies the IsLoadingOnDemand dependency property.
public static readonly DependencyProperty IsLoadingOnDemandProperty
IsLoadOnDemandEnabledProperty
DependencyProperty
Identifies the IsLoadOnDemandEnabled dependency property.
public static readonly DependencyProperty IsLoadOnDemandEnabledProperty
IsMouseOverHeaderProperty
DependencyProperty
Identifies the IsMouseOverHeader dependency property.
public static readonly DependencyProperty IsMouseOverHeaderProperty
IsSelectableProperty
DependencyProperty
Identifies the IsSelectable dependency property.
public static readonly DependencyProperty IsSelectableProperty
IsSelectedProperty
DependencyProperty
Identifies the IsSelected dependency property.
public static readonly DependencyProperty IsSelectedProperty
IsSelectionActiveProperty
DependencyProperty
Identifies the IsSelectionActive dependency property.
public static readonly DependencyProperty IsSelectionActiveProperty
IsSelectionActivePropertyKey
DependencyPropertyKey
Identifies the IsSelectionActivePropertyKey dependency property.
public static readonly DependencyPropertyKey IsSelectionActivePropertyKey
ItemVisibilityProperty
DependencyProperty
Identifies the ItemVisibility dependency property.
public static readonly DependencyProperty ItemVisibilityProperty
LoadOnDemandEvent
RoutedEvent
Identifies the LoadOnDemand routed event.
public static readonly RoutedEvent LoadOnDemandEvent
OptionTypeProperty
DependencyProperty
Identifies the OptionTypeProperty dependency property.
public static readonly DependencyProperty OptionTypeProperty
PreviewCheckedEvent
RoutedEvent
Identifies the PreviewChecked routed event.
public static readonly RoutedEvent PreviewCheckedEvent
PreviewCollapsedEvent
RoutedEvent
Identifies the PreviewCollapsed routed event.
public static readonly RoutedEvent PreviewCollapsedEvent
PreviewExpandedEvent
RoutedEvent
Identifies the PreviewExpanded routed event.
public static readonly RoutedEvent PreviewExpandedEvent
PreviewSelectedEvent
RoutedEvent
Identifies the PreviewSelected routed event.
public static readonly RoutedEvent PreviewSelectedEvent
PreviewUncheckedEvent
RoutedEvent
Identifies the PreviewUnchecked routed event.
public static readonly RoutedEvent PreviewUncheckedEvent
PreviewUnselectedEvent
RoutedEvent
Identifies the PreviewUnselected routed event.
public static readonly RoutedEvent PreviewUnselectedEvent
SelectedEvent
RoutedEvent
Identifies the Selected routed event.
public static readonly RoutedEvent SelectedEvent
SelectedImageSrcProperty
DependencyProperty
Identifies the SelectedImageSrc dependency property.
public static readonly DependencyProperty SelectedImageSrcProperty
UncheckedEvent
RoutedEvent
Identifies the Unchecked routed event.
public static readonly RoutedEvent UncheckedEvent
UnselectedEvent
RoutedEvent
Identifies the Unselected routed event.
public static readonly RoutedEvent UnselectedEvent
Properties
CheckState
ToggleState
Gets or sets the toggle state of the item - On, Off or Indeterminate.
public ToggleState CheckState { get; set; }
Gets or sets the command for Click event of the RadTreeViewItem.
public ICommand Command { get; set; }
The command.
Gets or sets a value indicating when the Command must be executed.
public CommandExecutionTrigger CommandExecutionTrigger { get; set; }
Gets or sets the command parameter of the RadTreeViewItem.
public object CommandParameter { get; set; }
The command parameter.
CommandTarget
IInputElement
Gets or sets the command target of the RadTreeViewItem when using routed command.
public IInputElement CommandTarget { get; set; }
The command target.
Gets or sets the image that the TreeViewItem will display by default.
public virtual object DefaultImageSrc { get; set; }
Gets or sets the DropPosition for the current drop (Before, Inside, After). Setting this property only makes sense in a DragDrop handler.
public DropPosition DropPosition { get; set; }
Gets or sets the image that the TreeViewItem will display when it is expanded.
public object ExpandedImageSrc { get; set; }
Gets or sets a value indicating the min width of the grid which hosts the expander button of the RadTreeViewItem.
public double ExpanderButtonMinWidth { get; set; }
ExpanderStyle
Style
Gets or sets the style for the item's expand arrow.
public Style ExpanderStyle { get; set; }
Gets the path from the root tree item to the current tree item delimited with the PathSeparator specified by RadTreeView.
[Browsable(false)]
public string FullPath { get; }
Gets the position of the tree item in the tree item collection.
[Browsable(false)]
public int Index { get; }
Gets whether the tree item will display a check box.
[Browsable(false)]
public bool IsCheckBoxEnabled { get; }
Gets or sets a value indicating whether the TreeView item is checked. Null means 'indeterminate'.
public bool? IsChecked { get; set; }
Gets or sets a value indicating whether an item is being dragged over the TreeViewItem.
[Browsable(false)]
public bool IsDragOver { get; set; }
Gets or sets a value indicating whether the tree item can accept data that the user drags onto it.
public bool IsDropAllowed { get; set; }
Gets or sets a value indicating whether the TreeViewItem is in the expanded state.
public bool IsExpanded { get; set; }
Gets a value indicating whether this item is in the selection path.
public bool IsInSelectedPath { get; }
Gets a value indicating whether the tree item is in ScrollViewer viewport.
public bool IsInViewport { get; }
Gets or sets whether the tree item is in loading on demand state.
public bool IsLoadingOnDemand { get; set; }
If the LoadOnDemand event is raised and there are no items to add, use IsLoadingOnDemand property and set it to false to stop the loading animation.
Gets or sets a value indicating whether loading on demand is enabled.
public bool IsLoadOnDemandEnabled { get; set; }
When the value is set to true the expander visual will be visible even if the item do no have children. When the expander visual is clicked, the event is raised and you can populate the node.
Gets a value indicating whether the mouse cursor is over the item header.
public bool IsMouseOverHeader { get; }
Gets a value if the item is root item.
[Browsable(false)]
public bool IsRootItem { get; }
Gets or sets a value indicating whether the tree item can be selected. It can be selected via Mouse, keyboard or by using IsSelected property. However, this property does not prevent the selection via SelectedItem or SelectedItems property of RadTreeView. These properties accept object(s) and might be evaluated when the corresponding containers are not generated yet.
public bool IsSelectable { get; set; }
Gets or sets a value indicating whether the tree item is in selected state.
public bool IsSelected { get; set; }
Gets whether the tree item selection is active - e.g. the item is selected and the TreeView is focused.
[Browsable(false)]
public bool IsSelectionActive { get; }
Gets the data item associated to the RadTreeViewItem.
public object Item { get; }
Use this property to get the data item, that is associated with this RadTreeViewItem when the RadTreeView is populated using the ItemsSource property.
ItemVisibility
Visibility
Gets or sets a value indicating when the item should be visible or not.
public Visibility ItemVisibility { get; set; }
Gets the zero-based depth of the tree item in the RadTreeView tree.
[Browsable(false)]
public int Level { get; }
Gets the next available item. Used for traversal of the tree view.
[Browsable(false)]
public RadTreeViewItem NextItem { get; }
Gets the next sibling tree item.
[Browsable(false)]
public RadTreeViewItem NextSiblingItem { get; }
Gets or sets the type of the option element that the item displays.
public OptionListType OptionType { get; set; }
Gets the parent tree view item of the current tree view item.
[Browsable(false)]
public RadTreeViewItem ParentItem { get; }
Gets the parent tree view associated with the current tree view item.
[Browsable(false)]
public RadTreeView ParentTreeView { get; }
Gets the previous available item. Used for traversal of the tree view.
[Browsable(false)]
public RadTreeViewItem PreviousItem { get; }
Gets the previous sibling tree item.
[Browsable(false)]
public RadTreeViewItem PreviousSiblingItem { get; }
Gets the root parent item for this instance.
public RadTreeViewItem RootItem { get; }
Gets or sets the image that the TreeViewItem displays when it is selected.
public object SelectedImageSrc { get; set; }
Methods
Attempts to start editing the item.
public override bool BeginEdit()
Returns true if successful, false otherwise.
Overrides:
Brings the item with the given index into view. The method will not work before the item containers have been generated.
public void BringIndexIntoView(int index)
The index of the item to be brought into view.
Brings the given item into view. This is not a recursive method, it will only work for immediate items. The method will not work before the item containers have been generated.
public void BringItemIntoView(object item)
The item to be brought into view.
Cancels the edit.
Updates the visual state of the control.
protected override void ChangeVisualState(bool useTransitions)
Indicates whether transitions should be used.
Overrides:
When overridden in a derived class, undoes the effects of the method.
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
The container element.
itemobjectThe Item.
Collapses the item and its child items recursively.
public void CollapseAll()
Tries to Commit edit.
public override bool CommitEdit()
Returns true if successful, false otherwise.
Overrides:
Checks if the item has a particular item in its collection.
public bool Contains(RadTreeViewItem item)
The item to be searched.
Returns:Boolean value indicating the item to be searched.
Ensures that a given item is displayed.
public void EnsureVisible()
Expands the item and its child items recursively.
public void ExpandAll()
If a child item is not generated it will be expanded once it is generated.
GetContainerForItemOverride()
DependencyObject
Creates or identifies the element that is used to display the given item.
protected override DependencyObject GetContainerForItemOverride()
DependencyObject
Gets a value indicating whether this item is rendered before the passed item.
Gets whether the the collection of dragged items can be dropped on the destination item.
public virtual bool IsDropPossible(IEnumerable draggedItems)
A collection of items that the user is dragging.
Returns:True if a drop is possible, false otherwise.
The method makes sure that parents will not be dropped in their children and that no items will be dropped in a destination which has its IsDropAllowed property set to false.
This method is not meant to implement business or application logic. The DragDrop events can be handled to implement additional validation / logic.
Measures the size of the control.
protected override Size MeasureOverride(Size availableSize)
Size
Called to apply the template to the RadTreeViewItem. This method is responsible for performing any necessary operations when the control's visual tree is generated.
public override void OnApplyTemplate()
Overrides:
This method is typically overridden in derived classes to implement custom template application logic.
Raises the event.
protected virtual void OnChecked(RadTreeViewCheckEventArgs e)
The RadTreeViewCheckEventArgs instance containing the event data.
Raises the event and tries to execute the .
protected virtual bool? OnClick(RadRoutedEventArgs e)
bool?
True if the command is executed; False if the command can not be executed; Null when command is not set or suppressing notifications.
Raises the event.
OnCreateAutomationPeer()
AutomationPeer
Returns class-specific AutomationPeer.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
The type-specific AutomationPeer implementation.
Raises the event and tries to execute the .
protected virtual bool? OnDoubleClick(RadRoutedEventArgs e)
bool?
True if the command is executed; False if the command can not be executed; Null when command is not set or suppressing notifications.
Raise the event.
Called before the event occurs.
protected override void OnGotFocus(RoutedEventArgs e)
The data for the event.
Called when KeyDown event occurs on the Header Edit Element.
protected virtual void OnHeaderEditElementKeyDown(object sender, KeyEventArgs e)
The sender.
eKeyEventArgsThe KeyEventArgs instance containing the event data.
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
The handler for the IsEnabledChanged event is fired.
protected virtual void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
The sender.
eDependencyPropertyChangedEventArgsThe DependencyPropertyChangedEventArgs instance containing the event data.
Invoked when the Items property changes.
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Called before the event occurs.
protected override void OnKeyDown(KeyEventArgs e)
The data for the event.
Raises the event.
protected virtual void OnLoadOnDemand(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Called before the event occurs.
protected override void OnLostFocus(RoutedEventArgs e)
The data for the event.
Raises the event.
protected virtual bool OnPreviewChecked(RadTreeViewCheckEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewCollapsed(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Returns:Prepares the editor for the TreeViewItem. This override binds the default TextBox to the property that is edited if necessary.
protected override void OnPreviewEditorPrepare(EditorPrepareEventArgs e)
The event arguments that will be passed to the PreviewEditorPrepare in the base implementation.
Overrides:
Raises the event.
protected virtual bool OnPreviewExpanded(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewSelected(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewUnchecked(RadTreeViewCheckEventArgs e)
The EventArgs instance containing the event data.
Returns:Raises the event.
protected virtual bool OnPreviewUnselected(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Returns:Raises the event.
protected virtual void OnSelected(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnUnchecked(RadTreeViewCheckEventArgs e)
The RadTreeViewCheckEventArgs instance containing the event data.
Raises the event.
protected virtual void OnUnselected(RadRoutedEventArgs e)
The RadRoutedEventArgs instance containing the event data.
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Element used to display the specified item.
itemobjectSpecified item.
Return item text value.
Events
Occurs when the item is checked.
public event EventHandler<RadRoutedEventArgs> Checked
Occurs after the tree item is clicked.
public event EventHandler<RadRoutedEventArgs> Click
Occurs after the tree item is collapsed.
public event EventHandler<RadRoutedEventArgs> Collapsed
Occurs after the tree item is double clicked.
public event EventHandler<RadRoutedEventArgs> DoubleClick
Occurs after the tree item is expanded.
public event EventHandler<RadRoutedEventArgs> Expanded
Occurs when the tree item should load its child items on demand.
public event EventHandler<RadRoutedEventArgs> LoadOnDemand
Occurs before the tree item is checked.
public event EventHandler<RadRoutedEventArgs> PreviewChecked
Occurs before an item is collapsed.
public event EventHandler<RadRoutedEventArgs> PreviewCollapsed
Occurs before an item is expanded.
public event EventHandler<RadRoutedEventArgs> PreviewExpanded
Occurs before the tree item is selected.
public event EventHandler<RadRoutedEventArgs> PreviewSelected
Occurs before the tree item is unchecked.
public event EventHandler<RadRoutedEventArgs> PreviewUnchecked
Occurs before an item is unselected.
public event EventHandler<RadRoutedEventArgs> PreviewUnselected
Occurs after the tree item is selected.
public event EventHandler<RadRoutedEventArgs> Selected
Occurs when the item is unchecked.
public event EventHandler<RadRoutedEventArgs> Unchecked
Occurs after the tree item is unselected.
public event EventHandler<RadRoutedEventArgs> Unselected