Click or drag to resize
RadTreeView Class
A hierarchical control used to display a tree of items.
Initializes a new instance of the RadTreeView class.
Inheritance Hierarchy

Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation (in Telerik.Windows.Controls.Navigation.dll) Version: 2017.3.913.40 (2017.3.913.40)
Syntax
public class RadTreeView : ItemsControl, 
	IScrollingServiceCore, IScrollingInfo, IThemable

The RadTreeView type exposes the following members.

Constructors
  NameDescription
Public methodRadTreeView
Initializes a new instance of the RadTreeView class.
Top
Methods
  NameDescription
Public methodAddItemByPath(String)
Creates a new item and adds a item by path. Can be used if the TreeView is not data bound.
Public methodAddItemByPath(String, String)
Creates a new item and adds a item by path. The label of the new item will be the text after the last separator.
Public methodAddItemsByPath
Adds an item at the given path, given that the TreeView is not bound.
Public methodBringIndexIntoView(Int32)
Brings the item with the given index into view. The method will not work before the item containers have been generated.
Public methodBringIndexIntoView(Int32, Point)
Brings the item with the given index into view. The method will not work before the item containers have been generated.
Public methodBringItemIntoView(Object)
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 methodBringItemIntoView(Object, Point)
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 methodBringPathIntoView(String)
Brings an item into view. Works recursively for nested containers. If the Loaded event has not been fired yet the method will be scheduled for execution after the Loaded event. The method will realize the required containers if they are not yet created.
Public methodBringPathIntoView(String, Point)
Brings an item into view. Works recursively for nested containers. If the Loaded event has not been fired yet the method will be scheduled for execution after the Loaded event. The method will realize the required containers if they are not yet created.
Protected methodChangeVisualState
Updates the visual state of the control.
Protected methodClearContainerForItemOverride
When overridden in a derived class, undoes the effects of the PrepareContainerForItemOverride(DependencyObject, Object) method.
(Overrides ItemsControlClearContainerForItemOverride(DependencyObject, Object).)
Public methodCollapseAll
Collapses all items recursively.
Public methodContainerFromItemRecursive
Recursively searches the tree view in the tree to get an item container (RadTreeViewItem) for the particular data item.
Protected methodCreateDragVisualContent
Creates default drag visual content - snapshot of all dragged items. Override this method in subclass in order to change the default drag visual content.
Public methodExpandAll
Expands all items recursively.
Public methodExpandItemByPath(String)
Expands to an item with a given path.
Public methodExpandItemByPath(String, String)
Expands to an item with a given path.
Protected methodGetContainerForItemOverride
Creates or identifies the element that is used to display the given item.
(Overrides ItemsControlGetContainerForItemOverride.)
Public methodGetItemByPath(String)
Gets a item by specifying a path to it.
Public methodGetItemByPath(String, String)
Gets a item by specifying a path to it.
Public methodHideBetweenItemsDragCue Obsolete.
Hides the drag cue that appears when a drop between two items is possible.
Protected methodIsItemItsOwnContainerOverride
Determines if the specified item is (or is eligible to be) its own container.
(Overrides ItemsControlIsItemItsOwnContainerOverride(Object).)
Public methodOnApplyTemplate
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate.
(Overrides FrameworkElementOnApplyTemplate.)
Protected methodOnCreateAutomationPeer
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
(Overrides UIElementOnCreateAutomationPeer.)
Protected methodOnDragEnded Obsolete.
Raises the [E:DragEnded] event.
Protected methodOnDragEnter
Called when DragEnter Event is Raise.
(Overrides UIElementOnDragEnter(DragEventArgs).)
Protected methodOnDragLeave
Called when DragEnter Event is Raise.
(Overrides UIElementOnDragLeave(DragEventArgs).)
Protected methodOnDragOverTree Obsolete.
Raises the [E:DragOverTree] event.
Protected methodOnDragStarted Obsolete.
Raises the [E:DragStarted] event.
Protected methodOnDrop
Called when DragEnter Event is Raise.
(Overrides UIElementOnDrop(DragEventArgs).)
Protected methodOnExpanderStyleChanged
Propagates the changed expander style through tree's children. Called when the ExpanderStyleInherited property changes.
Protected methodOnGotFocus
Called when the TreeView or one of its items receive focus.
Protected methodOnInitialized
Raises the Initialized event. This method is invoked whenever IsInitialized is set to true internally.
(Overrides FrameworkElementOnInitialized(EventArgs).)
Protected methodOnItemPrepared
Raises the [E:DragEnded] event.
Protected methodOnItemsChanged
Invoked when the Items property changes.
(Overrides ItemsControlOnItemsChanged(NotifyCollectionChangedEventArgs).)
Protected methodOnLostFocus
Called when the TreeView or one of its items lose focus.
Protected methodOnMouseLeftButtonDown
Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
(Overrides UIElementOnMouseLeftButtonDown(MouseButtonEventArgs).)
Protected methodOnMouseWheel
Invoked when an unhandled MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
(Overrides UIElementOnMouseWheel(MouseWheelEventArgs).)
Protected methodOnPreviewDragEnded Obsolete.
Raises the [E:PreviewDragEnded] event.
Protected methodOnPreviewDragStarted Obsolete.
Raises the [E:PreviewDragStarted] event.
Protected methodOnPreviewSelectionChanged
This method is called when the PreviewSelectionChanged is raised.
Protected methodOnSelectionChanged
Raises the [E:SelectionChanged] event.
Protected methodPrepareContainerForItemOverride
Prepares the specified element to display the specified item.
(Overrides ItemsControlPrepareContainerForItemOverride(DependencyObject, Object).)
Public methodResetTheme
Resets the theme.
Public methodSelectItemByPath(String)
Adds the item with the given path to the collection of selected items. The path separator is "\".
Public methodSelectItemByPath(String, String)
Adds the item with the given path to the collection of selected items. The path separator is "\".
Public methodShowBetweenItemsDragCue Obsolete.
Shows the DragCue that appears when a drop between two items is possible.
Public methodUpdateDropPreviewLine
Updates the drop preview line position and visibility while dragging.
Top
Extension Methods
  NameDescription
Public Extension MethodChildrenOfTypeT
Gets all child elements recursively from the visual tree by given type.
(Defined by ChildrenOfTypeExtensions.)
Public Extension MethodClearIfNoBindingAndSet
Clears if set.
(Defined by CommonExtensions.)
Public Extension MethodClearIfSet
Clears the property if a value has been set.
(Defined by CommonExtensions.)
Public Extension MethodDeserializePrimitives
Deserializes some primitive properties of a control.
(Defined by SerializationExtensions.)
Public Extension MethodEnableLayoutRounding (Defined by LayoutRoundingHelperExtensions.)
Public Extension MethodFindChildByTypeT
Finds child element of the specified type. Uses breadth-first search.
(Defined by ChildrenOfTypeExtensions.)
Public Extension MethodGetAssociatedInlineUIContainer (Defined by ExtensionMethods.)
Public Extension MethodGetAssociatedLayoutBox (Defined by ExtensionMethods.)
Public Extension MethodGetBaseControlItemStatus
Gets a string that communicates the visual status of a Control.
(Defined by AutomationExtensions.)
Public Extension MethodGetBoundsRelativeTo
Gets the bounds relative to the current framework element.
(Defined by ExtensionMethods.)
Public Extension MethodGetGlobalMousePosition
(Defined by WindowHost.)
Public Extension MethodGetParents
Enumerates through element's parents in the visual tree.
(Defined by ParentOfTypeExtensions.)
Public Extension MethodGetVisualParentT
Searches up in the visual tree for parent element of the specified type.
(Defined by ParentOfTypeExtensions.)
Public Extension MethodIsAncestorOf(DependencyObject)Overloaded.
Determines whether the element is ancestor of the current UI element.
(Defined by ExtensionMethods.)
Public Extension MethodIsAncestorOf(DependencyObject)Overloaded.
Determines whether the element is an ancestor of the descendant.
(Defined by ParentOfTypeExtensions.)
Public Extension MethodIsKeyboardFocusWithin
Determines whether keyboard focus is within the current UI element.
(Defined by KeyboardHelper.)
Public Extension MethodIsLocalValueSet(DependencyProperty)Overloaded.
Determines whether the specified dependency property local value is set.
(Defined by DependencyObjectExtensions.)
Public Extension MethodIsLocalValueSet(DependencyProperty)Overloaded.
Determines whether the specified dependency property local value is set.
(Defined by CommonExtensions.)
Public Extension MethodParentOfTypeT
Gets the parent element from the visual tree by given type.
(Defined by ParentOfTypeExtensions.)
Public Extension MethodSerializePrimitives
Serializes some primitive properties of a control.
(Defined by SerializationExtensions.)
Public Extension MethodSetAssociatedLayoutBox (Defined by ExtensionMethods.)
Public Extension MethodSetIfDifferent
Sets the value of the dependencyProperty property if it's hasn't that value currently.
(Defined by CommonExtensions.)
Public Extension MethodSetLayout
Sets the location in the element in Canvas.
(Defined by CommonExtensions.)
Public Extension MethodSetLocation(Point)Overloaded.
Sets the location in the element in Canvas.
(Defined by CommonExtensions.)
Public Extension MethodSetLocation(Double, Double)Overloaded.
Sets the location in the element in Canvas.
(Defined by CommonExtensions.)
Public Extension MethodSlideInOverloaded.
Slides the given element into view. This is an extension method.
(Defined by CalendarAnimation.)
Public Extension MethodSlideIn(TimeSpan)Overloaded.
Slides the given element into view. This is an extension method.
(Defined by CalendarAnimation.)
Public Extension MethodSlideOutOverloaded.
Slides the given element out of view. This is an extension method.
(Defined by CalendarAnimation.)
Public Extension MethodSlideOut(TimeSpan)Overloaded.
Slides the given element out of view. This is an extension method.
(Defined by CalendarAnimation.)
Public Extension MethodTranslate(NullableDouble, NullableDouble, NullableDouble, NullableDouble, TimeSpan)Overloaded.
Translates the target element as requested by the parameters.
(Defined by CalendarAnimation.)
Public Extension MethodTranslate(NullableDouble, NullableDouble, NullableDouble, NullableDouble, TimeSpan, Action)Overloaded.
Translates the target element as requested by the parameters and executes the action request.
(Defined by CalendarAnimation.)
Top
Fields
  NameDescription
Public fieldStatic memberAutoScrollToSelectedItemProperty
Identifies the AutoScrollToSelectedItem property.
Public fieldStatic memberBringIntoViewModeProperty
Identifies the BringIntoView property.
Public fieldStatic memberCheckedItemsProperty
Identifies the CheckedItemsProperty dependency property.
Public fieldStatic memberDragEndedEvent Obsolete.
Identifies the DragEnded routed event.
Public fieldStatic memberDragOverTreeEvent Obsolete.
Identifies the DragOverTree routed event.
Public fieldStatic memberDragStartedEvent Obsolete.
Identifies the DragStarted routed event.
Public fieldStatic memberDropExpandDelayProperty
Identifies the DropExpandDelay property.
Public fieldStatic memberExpanderStyleProperty
Identifies the ExpanderStyle dependency property.
Public fieldStatic memberImagesBaseDirProperty
Identifies the ImagesBaseDirectory dependency property.
Public fieldStatic memberIsDragDropEnabledProperty
Identifies the IsDragDropEnabled dependency property.
Public fieldStatic memberIsDragPreviewEnabledProperty
Identifies the IsDragPreviewEnabled dependency property.
Public fieldStatic memberIsDragTooltipEnabledProperty
Identifies the IsDragTooltipEnabled dependency property.
Public fieldStatic memberIsDropPreviewLineEnabledProperty
Identifies the IsDropPreviewLineEnabled dependency property.
Public fieldStatic memberIsEditableProperty
Identifies the IsEditable dependency property.
Public fieldStatic memberIsExpandOnDblClickEnabledProperty
Identifies the IsExpandOnDoubleClickEnabled dependency property.
Public fieldStatic memberIsExpandOnSingleClickEnabledProperty
Identifies the IsExpandOnSingleClickEnabled dependency property.
Public fieldStatic memberIsLineEnabledProperty
Identifies the IsLineEnabled dependency property.
Public fieldStatic memberIsLoadOnDemandEnabledProperty
Identifies the IsLoadOnDemandEnabled dependency property.
Public fieldStatic memberIsOptionElementsEnabledProperty
Identifies the IsOptionElementsEnabled dependency property.
Public fieldStatic memberIsRootLinesEnabledProperty
Identifies the IsRootLinesEnabled dependency property.
Public fieldStatic memberIsSingleExpandPathProperty
Identifies the IsSingleExpandPath dependency property.
Public fieldStatic memberIsTriStateModeProperty
Identifies the IsTriStateMode dependency property.
Public fieldStatic memberItemEditTemplateProperty
Identifies the ItemEditTemplate dependency property.
Public fieldStatic memberItemEditTemplateSelectorProperty
Identifies the ItemEditTemplateSelector dependency property.
Public fieldStatic memberItemsIndentProperty
Identifies the ItemsIndent dependency property.
Public fieldStatic memberPathSeparatorProperty
Identifies the PathSeparator dependency property.
Public fieldStatic memberPreviewDragEndedEvent Obsolete.
Identifies the PreviewDragEnded routed event.
Public fieldStatic memberPreviewDragStartedEvent Obsolete.
Identifies the PreviewDragStarted routed event.
Public fieldStatic memberPreviewSelectionChangedEvent
Identifies the PreviewSelectionChanged routed event.
Public fieldStatic memberSelectedContainerProperty
Identifies the SelectedContainer property.
Public fieldStatic memberSelectedItemProperty
Identifies the SelectedItem property.
Public fieldStatic memberSelectedItemsProperty
Identifies the SelectedItemsProperty dependency property.
Public fieldStatic memberSelectedValuePathProperty
Identifies the SelectedValuePath dependency property.
Public fieldStatic memberSelectedValueProperty
Identifies the SelectedValue dependency property.
Public fieldStatic memberSelectionChangedEvent
Identifies the SelectionChanged routed event.
Public fieldStatic memberSelectionModeProperty
Identifies the SelectionMode dependency property.
Public fieldStatic memberTextDropAfterProperty
Identifies the TextDropAfter dependency property.
Public fieldStatic memberTextDropBeforeProperty
Identifies the TextDropBefore dependency property.
Public fieldStatic memberTextDropInProperty
Identifies the TextDropIn dependency property.
Public fieldStatic memberTextDropRootProperty
Identifies the TextDropRoot dependency property.
Top
Properties
  NameDescription
Public propertyAutoScrollToSelectedItem
Gets or sets a value indicating whether the selected RadTreeViewItem should be scrolled into the viewport. When using virtualization this property works only for realized RadTreeViewItem(s).
Public propertyBringIntoViewMode
Gets or sets whether just the item's header should be brought into view when the respective methods are called of the header and its items.
Public propertyCheckedItems
Gets a collection containing the items that are currently checked.
Public propertyDropExpandDelay
Gets or sets the time has to pass before an item will be expanded because of something being dragged over it. This is a dependency property.
Public propertyCode exampleExpanderStyle
Gets or sets the style of RadTreeViewItem expander button.
Public propertyImagesBaseDir
Gets or sets the directory where image files used for the TreeView images.
Public propertyIsDragDropEnabled
Gets or sets a value indicating whether drag and drop is enabled.
Public propertyIsDragPreviewEnabled
Gets or sets a value indicating whether drag feedback is shown while dragging.
Public propertyIsDragTooltipEnabled
Gets or sets a value indicating whether drag tooltip is shown while dragging.
Public propertyIsDropPreviewLineEnabled
Gets or sets a value indicating whether drag outline is shown while dragging.
Public propertyIsEditable
Gets or sets a value indicating whether the user can edit the TreeViewItems.
Public propertyIsEditing
Gets if there is an open editor in the tree view.
Public propertyIsExpandOnDblClickEnabled
Gets or sets a value whether the item will toggle its expand state on double click.
Public propertyIsExpandOnSingleClickEnabled
Gets or sets a value indicating whether the item will toggle its expand state on single click.
Public propertyIsLineEnabled
Gets or sets a value indicating whether connecting lines are displayed.
Public propertyIsLoadOnDemandEnabled
Gets or sets a value indicating whether loading on demand is enabled.
Public propertyIsOptionElementsEnabled
Gets or sets a value indicating whether checkboxes/radio buttons are displayed besides the TreeViewItems.
Public propertyIsRootLinesEnabled
Gets or sets a value indicating whether lines are displayed next to root item.
Public propertyIsSingleExpandPath
Gets a value indicating whether only one branch of the TreeView will be expanded.
Public propertyIsTriStateMode
Gets or sets a value indicating whether tri state mode for the checkboxes in the option lists is enabled.
Public propertyIsVirtualizing
Gets or sets a value indicating whether the TreeView should virtualize its items. Virtualization should be used only when the TreeView is data bound.
Public propertyItemEditTemplate
Gets or sets the template that the items will display when edited.
Public propertyItemEditTemplateSelector
Gets or sets the template selector that the items will use to select a template to display when edited.
Public propertyItemsIndent
Gets or sets the distance that each tree item level will be indented.
Public propertyPathSeparator
Gets or sets the delimiter string that the tree item path uses.
Public propertyCode exampleScrollViewer
Gets the ScrollViewer control the is inside the RadTreeView.
Public propertySelectedContainer
Gets the TreeViewItem container that is currently selected. This is a dependency property.
Public propertySelectedItem
Gets or sets the item that is currently selected. This is a dependency property.
Public propertySelectedItems
Gets a collection containing the items that are currently selected.
Public propertySelectedValue
Gets or sets the value of the SelectedItem, obtained by using SelectedValuePath.
Public propertySelectedValuePath
Gets or sets the path that is used to extract the SelectedValue from the SelectedItem.
Public propertySelectionMode
Gets or sets the selection mode.
Public propertyTextDropAfter
Gets or sets the text "Drop after" text of the drag preview.
Public propertyTextDropBefore
Gets or sets the text "Drop before" text of the drag preview.
Public propertyTextDropIn
Gets or sets the text for "Drop in" text of the drag preview.
Public propertyTextDropRoot
Gets or sets the text that appears when an item is dropped in an empty TreeView.
Top
Events
  NameDescription
Public eventCode exampleChecked
Occurs when a child TreeView item has been checked.
Public eventCode exampleCollapsed
Occurs when a child TreeView item has been collapsed.
Public eventCode exampleDragEnded Obsolete.
Occurs when the drag has ended.
Public eventDragOverTree Obsolete.
Occurs when the dragging over the tree view.
Public eventCode exampleDragStarted Obsolete.
Occurs when the drag has started.
Public eventEditCanceled
Raised when item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.EditCanceled routed event.
Public eventCode exampleEdited
Raised when the edit of an item has been committed.
Public eventEditStarted
Raised when the edit of an item has just started. This is a wrapper for the EditableHeaderedItemsControl.EditStarted routed event.
Public eventCode exampleExpanded
Occurs when a child TreeView item has been expanded.
Public eventItemClick
Occurs when a child TreeView item has been clicked.
Public eventItemDoubleClick
Occurs when a child TreeView item has been double clicked.
Public eventCode exampleItemPrepared
Occurs when a child RadTreeViewItem has been prepared and is ready for use.
Public eventCode exampleLoadOnDemand
Occurs when a child TreeView item is loading its child items on demand. See the IsLoadOnDemandEnabled property.
Public eventCode examplePreviewChecked
Occurs before a child TreeView item is checked.
Public eventCode examplePreviewCollapsed
Occurs before a child TreeView item is collapsed.
Public eventCode examplePreviewDragEnded Obsolete.
Occurs before the drag has been ended.
Public eventCode examplePreviewDragStarted Obsolete.
Occurs before the drag is started.
Public eventPreviewEditCanceled
Raised just before item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditCanceled routed event.
Public eventCode examplePreviewEdited
Occurs before a TreeView item to accept the new Edited data.
Public eventPreviewEditStarted
Raised just before editing of an item has started. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditStarted routed event.
Public eventCode examplePreviewExpanded
Occurs before a child TreeView item is expanded.
Public eventCode examplePreviewSelected
Occurs before a child tree view item is selected.
Public eventPreviewSelectionChanged
Raised just before the selected items collection has changed.
Public eventCode examplePreviewUnchecked
Occurs before a child TreeView item is unchecked.
Public eventCode examplePreviewUnselected
Occurs before a child tree view item is unselected.
Public eventCode exampleSelected
Occurs when a child RadTreeView item has been selected.
Public eventCode exampleSelectionChanged
Occurs after the value of the SelectedItems property of a tree is changed.
Public eventCode exampleUnchecked
Occurs when a child TreeView item has been unchecked.
Public eventCode exampleUnselected
Occurs when a child tree view item has been unselected.
Top
Remarks

The RadTreeView control is used to display a list of items. The RadTreeView control supports the following features:

  • DataBinding that allows the control to be populated from various data sources.
  • Programmatic access to the RadTreeView object model which allows dynamic creation of TreeViews, populating with items and customizing the behavior by various properties.
  • Customizable appearance through built-in or user-defined skins.

items

The RadTreeView control is made up of tree of items represented by RadTreeViewItem objects. Items at the top level (level 0) are called root items. An item that has a parent item is called a child item. All root items are stored in the Items property of the RadTreeView control. Child items are stored in the Items property of their parent RadTreeViewItem.

Each item has a Header and a Tag property. The value of the Header property is displayed in the RadTreeView control, while the Tag property is used to store any additional data about the item.

See Also