Class
RadTreeView

A hierarchical control used to display a tree of items.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Navigation")]
[Themable]
public class RadTreeView : ItemsControl, IScrollingServiceCore, IScrollingInfo

Inheritance: objectRadTreeView

Derived Classes: FileBrowserTreeViewRadPanelBar

Implements: IScrollingInfoIScrollingServiceCore

Constructors

RadTreeView()

Initializes a new instance of the RadTreeView class.

Declaration

cs-api-definition
public RadTreeView()

Remarks

Use this constructor to create and initialize a new instance of the RadTreeView control.

Fields

AutoScrollToSelectedItemProperty

Identifies the AutoScrollToSelectedItem property.

Declaration

cs-api-definition
public static readonly DependencyProperty AutoScrollToSelectedItemProperty

Field Value

DependencyProperty

BringIntoViewModeProperty

Identifies the BringIntoView property.

Declaration

cs-api-definition
public static readonly DependencyProperty BringIntoViewModeProperty

Field Value

DependencyProperty

CheckedItemsProperty

Identifies the CheckedItemsProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CheckedItemsProperty

Field Value

DependencyProperty

DragEndedEvent

Identifies the DragEnded routed event.

Declaration

cs-api-definition
[Obsolete("This property will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public static readonly RoutedEvent DragEndedEvent

Field Value

RoutedEvent

DragOverTreeEvent

Identifies the DragOverTree routed event.

Declaration

cs-api-definition
[Obsolete("This property will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public static readonly RoutedEvent DragOverTreeEvent

Field Value

RoutedEvent

DragStartedEvent

Identifies the DragStarted routed event.

Declaration

cs-api-definition
[Obsolete("This property will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public static readonly RoutedEvent DragStartedEvent

Field Value

RoutedEvent

DropExpandDelayProperty

Identifies the DropExpandDelay property.

Declaration

cs-api-definition
public static readonly DependencyProperty DropExpandDelayProperty

Field Value

DependencyProperty

ExpanderStyleProperty

Identifies the ExpanderStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ExpanderStyleProperty

Field Value

DependencyProperty

ImagesBaseDirProperty

Identifies the ImagesBaseDirectory dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ImagesBaseDirProperty

Field Value

DependencyProperty

IsDragDropEnabledProperty

Identifies the IsDragDropEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDragDropEnabledProperty

Field Value

DependencyProperty

IsDragPreviewEnabledProperty

Identifies the IsDragPreviewEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDragPreviewEnabledProperty

Field Value

DependencyProperty

IsDragTooltipEnabledProperty

Identifies the IsDragTooltipEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDragTooltipEnabledProperty

Field Value

DependencyProperty

IsDropPreviewLineEnabledProperty

Identifies the IsDropPreviewLineEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDropPreviewLineEnabledProperty

Field Value

DependencyProperty

IsEditableProperty

Identifies the IsEditable dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsEditableProperty

Field Value

DependencyProperty

IsExpandOnDblClickEnabledProperty

Identifies the IsExpandOnDoubleClickEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsExpandOnDblClickEnabledProperty

Field Value

DependencyProperty

IsExpandOnSingleClickEnabledProperty

Identifies the IsExpandOnSingleClickEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsExpandOnSingleClickEnabledProperty

Field Value

DependencyProperty

IsLineEnabledProperty

Identifies the IsLineEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsLineEnabledProperty

Field Value

DependencyProperty

IsLoadOnDemandEnabledProperty

Identifies the IsLoadOnDemandEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsLoadOnDemandEnabledProperty

Field Value

DependencyProperty

IsOptionElementsEnabledProperty

Identifies the IsOptionElementsEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsOptionElementsEnabledProperty

Field Value

DependencyProperty

IsRootLinesEnabledProperty

Identifies the IsRootLinesEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsRootLinesEnabledProperty

Field Value

DependencyProperty

IsSingleExpandPathProperty

Identifies the IsSingleExpandPath dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsSingleExpandPathProperty

Field Value

DependencyProperty

IsTriStateModeProperty

Identifies the IsTriStateMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsTriStateModeProperty

Field Value

DependencyProperty

ItemEditTemplateProperty

Identifies the ItemEditTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ItemEditTemplateProperty

Field Value

DependencyProperty

ItemEditTemplateSelectorProperty

Identifies the ItemEditTemplateSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ItemEditTemplateSelectorProperty

Field Value

DependencyProperty

ItemsIndentProperty

Identifies the ItemsIndent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ItemsIndentProperty

Field Value

DependencyProperty

PathSeparatorProperty

Identifies the PathSeparator dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty PathSeparatorProperty

Field Value

DependencyProperty

PerformSelectionOnMouseUpProperty

Identifies the PerformSelectionOnMouseUp property.

Declaration

cs-api-definition
public static readonly DependencyProperty PerformSelectionOnMouseUpProperty

Field Value

DependencyProperty

PreviewDragEndedEvent

Identifies the PreviewDragEnded routed event.

Declaration

cs-api-definition
[Obsolete("This property will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public static readonly RoutedEvent PreviewDragEndedEvent

Field Value

RoutedEvent

PreviewDragStartedEvent

Identifies the PreviewDragStarted routed event.

Declaration

cs-api-definition
[Obsolete("This property will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public static readonly RoutedEvent PreviewDragStartedEvent

Field Value

RoutedEvent

PreviewSelectionChangedEvent

Identifies the PreviewSelectionChanged routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent PreviewSelectionChangedEvent

Field Value

RoutedEvent

SelectedContainerProperty

Identifies the SelectedContainer property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedContainerProperty

Field Value

DependencyProperty

SelectedItemProperty

Identifies the SelectedItem property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedItemProperty

Field Value

DependencyProperty

SelectedItemsProperty

Identifies the SelectedItemsProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedItemsProperty

Field Value

DependencyProperty

SelectedValuePathProperty

Identifies the SelectedValuePath dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedValuePathProperty

Field Value

DependencyProperty

SelectedValueProperty

Identifies the SelectedValue dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedValueProperty

Field Value

DependencyProperty

SelectionChangedEvent

Identifies the SelectionChanged routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent SelectionChangedEvent

Field Value

RoutedEvent

SelectionModeProperty

Identifies the SelectionMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectionModeProperty

Field Value

DependencyProperty

TextDropAfterProperty

Identifies the TextDropAfter dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextDropAfterProperty

Field Value

DependencyProperty

TextDropBeforeProperty

Identifies the TextDropBefore dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextDropBeforeProperty

Field Value

DependencyProperty

TextDropInProperty

Identifies the TextDropIn dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextDropInProperty

Field Value

DependencyProperty

TextDropRootProperty

Identifies the TextDropRoot dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextDropRootProperty

Field Value

DependencyProperty

TextSearchModeProperty

Identifies the TextSearchMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextSearchModeProperty

Field Value

DependencyProperty

Properties

AutoScrollToSelectedItem

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).

Declaration

cs-api-definition
public bool AutoScrollToSelectedItem { get; set; }

Property Value

bool

BringIntoViewMode

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.

Declaration

cs-api-definition
public BringIntoViewMode BringIntoViewMode { get; set; }

Property Value

BringIntoViewMode

CheckedItems

Gets a collection containing the items that are currently checked.

Declaration

cs-api-definition
public ICollection<object> CheckedItems { get; }

Property Value

ICollection<object>

DropExpandDelay

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.

Declaration

cs-api-definition
public TimeSpan DropExpandDelay { get; set; }

Property Value

TimeSpan

ExpanderStyle

Gets or sets the style of RadTreeViewItem expander button.

Declaration

cs-api-definition
[Browsable(false)]
public Style ExpanderStyle { get; set; }

Property Value

Style

Remarks

The expander button is a ToggleButton. To modify the appearance of the expander first create a Style for a ToggleButton and then set the defined style to this property.

ImagesBaseDir

Gets or sets the directory where image files used for the TreeView images.

Declaration

cs-api-definition
public string ImagesBaseDir { get; set; }

Property Value

string

IsDragDropEnabled

Gets or sets a value indicating whether drag and drop is enabled.

Declaration

cs-api-definition
public bool IsDragDropEnabled { get; set; }

Property Value

bool

IsDragPreviewEnabled

Gets or sets a value indicating whether drag feedback is shown while dragging.

Declaration

cs-api-definition
public bool IsDragPreviewEnabled { get; set; }

Property Value

bool

IsDragTooltipEnabled

Gets or sets a value indicating whether drag tooltip is shown while dragging.

Declaration

cs-api-definition
public bool IsDragTooltipEnabled { get; set; }

Property Value

bool

IsDropPreviewLineEnabled

Gets or sets a value indicating whether drag outline is shown while dragging.

Declaration

cs-api-definition
public bool IsDropPreviewLineEnabled { get; set; }

Property Value

bool

IsEditable

Gets or sets a value indicating whether the user can edit the TreeViewItems.

Declaration

cs-api-definition
public bool IsEditable { get; set; }

Property Value

bool

IsEditing

Gets if there is an open editor in the tree view.

Declaration

cs-api-definition
[Browsable(false)]
public virtual bool IsEditing { get; }

Property Value

bool

IsExpandOnDblClickEnabled

Gets or sets a value whether the item will toggle its expand state on double click.

Declaration

cs-api-definition
public bool IsExpandOnDblClickEnabled { get; set; }

Property Value

bool

IsExpandOnSingleClickEnabled

Gets or sets a value indicating whether the item will toggle its expand state on single click.

Declaration

cs-api-definition
public bool IsExpandOnSingleClickEnabled { get; set; }

Property Value

bool

IsLineEnabled

Gets or sets a value indicating whether connecting lines are displayed.

Declaration

cs-api-definition
public bool IsLineEnabled { get; set; }

Property Value

bool

IsLoadOnDemandEnabled

Gets or sets a value indicating whether loading on demand is enabled.

Declaration

cs-api-definition
public bool IsLoadOnDemandEnabled { get; set; }

Property Value

bool

Remarks

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.

IsOptionElementsEnabled

Gets or sets a value indicating whether checkboxes/radio buttons are displayed besides the TreeViewItems.

Declaration

cs-api-definition
public bool IsOptionElementsEnabled { get; set; }

Property Value

bool

IsRootLinesEnabled

Gets or sets a value indicating whether lines are displayed next to root item.

Declaration

cs-api-definition
public bool IsRootLinesEnabled { get; set; }

Property Value

bool

IsSingleExpandPath

Gets a value indicating whether only one branch of the TreeView will be expanded.

Declaration

cs-api-definition
public bool IsSingleExpandPath { get; set; }

Property Value

bool

Remarks

The property closes all item that are not parents of the last expanded item.

IsTriStateMode

Gets or sets a value indicating whether tri state mode for the checkboxes in the option lists is enabled.

Declaration

cs-api-definition
public bool IsTriStateMode { get; set; }

Property Value

bool

Remarks

When the value is set to true the checked state of the item depends on the checked state of its child items. When the checked state of the item is changed - the child items state is also changed.

IsVirtualizing

Gets or sets a value indicating whether the TreeView should virtualize its items. Virtualization should be used only when the TreeView is data bound.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Virtualizing", Justification = "This is the correct spelling")]
public bool IsVirtualizing { get; set; }

Property Value

bool

Remarks

This is a CLR wrapper for the TreeViewPanel.IsVirtualizing property. It will only work if the ItemsPanel of the TreeViewItem is a TreeViewPanel.

ItemEditTemplate

Gets or sets the template that the items will display when edited.

Declaration

cs-api-definition
public DataTemplate ItemEditTemplate { get; set; }

Property Value

DataTemplate

The item edit template.

ItemEditTemplateSelector

Gets or sets the template selector that the items will use to select a template to display when edited.

Declaration

cs-api-definition
public DataTemplateSelector ItemEditTemplateSelector { get; set; }

Property Value

DataTemplateSelector

The item edit template selector.

ItemsIndent

Gets or sets the distance that each tree item level will be indented.

Declaration

cs-api-definition
public int ItemsIndent { get; set; }

Property Value

int

PathSeparator

Gets or sets the delimiter string that the tree item path uses.

Declaration

cs-api-definition
public string PathSeparator { get; set; }

Property Value

string

Remarks

The tree item path contains of a set of tree item labels separated by the PathSeparator delimiter strings.
The default return value is the backslash character ().

PerformSelectionOnMouseUp

Gets or sets a boolean value indicating whether the selection will be performed on mouse up.

Declaration

cs-api-definition
public bool PerformSelectionOnMouseUp { get; set; }

Property Value

bool

ScrollViewer

Gets the ScrollViewer control the is inside the RadTreeView.

Declaration

cs-api-definition
public ScrollViewer ScrollViewer { get; }

Property Value

ScrollViewer

Remarks

Use the ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VerticalScrollBarVisibility attached properties to set the visibility of the ScrollBars.

SelectedContainer

Gets the TreeViewItem container that is currently selected. This is a dependency property.

Declaration

cs-api-definition
public RadTreeViewItem SelectedContainer { get; }

Property Value

RadTreeViewItem

SelectedItem

Gets or sets the item that is currently selected. This is a dependency property.

Declaration

cs-api-definition
public object SelectedItem { get; set; }

Property Value

object

SelectedItems

Gets a collection containing the items that are currently selected.

Declaration

cs-api-definition
[Browsable(false)]
public ObservableCollection<object> SelectedItems { get; }

Property Value

ObservableCollection<object>

SelectedValue

Gets or sets the value of the SelectedItem, obtained by using SelectedValuePath.

Declaration

cs-api-definition
public object SelectedValue { get; }

Property Value

object

SelectedValuePath

Gets or sets the path that is used to extract the SelectedValue from the SelectedItem.

Declaration

cs-api-definition
public string SelectedValuePath { get; set; }

Property Value

string

SelectionMode

Gets or sets the selection mode.

Declaration

cs-api-definition
public SelectionMode SelectionMode { get; set; }

Property Value

SelectionMode

TextDropAfter

Gets or sets the text "Drop after" text of the drag preview.

Declaration

cs-api-definition
public string TextDropAfter { get; set; }

Property Value

string

The text drop after.

TextDropBefore

Gets or sets the text "Drop before" text of the drag preview.

Declaration

cs-api-definition
public string TextDropBefore { get; set; }

Property Value

string

The text drop before.

TextDropIn

Gets or sets the text for "Drop in" text of the drag preview.

Declaration

cs-api-definition
public string TextDropIn { get; set; }

Property Value

string

The text drop in.

TextDropRoot

Gets or sets the text that appears when an item is dropped in an empty TreeView.

Declaration

cs-api-definition
public string TextDropRoot { get; set; }

Property Value

string

The text drop in.

TextSearchMode

Gets or sets the text search mode. Specifies how TextSearch will match items. This is a dependency property.

Declaration

cs-api-definition
public TextSearchMode TextSearchMode { get; set; }

Property Value

TextSearchMode

The text search mode.

Methods

AddItemByPath(string)

Creates a new item and adds a item by path. Can be used if the TreeView is not data bound.

Declaration

cs-api-definition
public RadTreeViewItem AddItemByPath(string path)

Parameters

path

string

Where the item should be added.

Returns

RadTreeViewItem

The new item if the operation is successful.

AddItemByPath(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.

Declaration

cs-api-definition
public RadTreeViewItem AddItemByPath(string path, string separator)

Parameters

path

string

Where the item should be added.

separator

string

The path separator.

Returns

RadTreeViewItem

The new item if the operation is successful.

AddItemsByPath(string, string)

Adds an item at the given path, given that the TreeView is not bound.

Declaration

cs-api-definition
public RadTreeViewItem AddItemsByPath(string path, string separator)

Parameters

path

string

The path to create an item at.

separator

string

The path separator.

Returns

RadTreeViewItem

The newly created RadTreeViewItem.

BringIndexIntoView(int)

Brings the item with the given index into view. The method will not work before the item containers have been generated.

Declaration

cs-api-definition
public void BringIndexIntoView(int index)

Parameters

index

int

The index of the item to be brought into view.

BringIndexIntoView(int, Point)

Brings the item with the given index into view. The method will not work before the item containers have been generated.

Declaration

cs-api-definition
public void BringIndexIntoView(int index, Point offset)

Parameters

index

int

The index of the item to be brought into view.

offset

Point

The offset to tree view top left corner where the item should be scrolled to.

BringItemIntoView(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.

Declaration

cs-api-definition
public void BringItemIntoView(object item)

Parameters

item

object

The item to be brought into view.

BringItemIntoView(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.

Declaration

cs-api-definition
public void BringItemIntoView(object item, Point offset)

Parameters

item

object

The item to be brought into view.

offset

Point

The offset to tree view top left corner where the item should be scrolled to.

BringPathIntoView(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.

Declaration

cs-api-definition
public void BringPathIntoView(string path)

Parameters

path

string

The path of the item to be brought into view.

BringPathIntoView(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.

Declaration

cs-api-definition
public void BringPathIntoView(string path, Point offset)

Parameters

path

string

The path of the item to be brought into view.

offset

Point

The offset from the top left corner of the tree where the item will be scrolled to.

ChangeVisualState(bool)

Updates the visual state of the control.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")]
protected void ChangeVisualState(bool useTransitions)

Parameters

useTransitions

bool

ClearContainerForItemOverride(DependencyObject, object)

Declaration

cs-api-definition
protected override void ClearContainerForItemOverride(DependencyObject element, object item)

Parameters

element

DependencyObject

item

object

CollapseAll()

Collapses all items recursively.

Declaration

cs-api-definition
public void CollapseAll()

ContainerFromItemRecursive(object)

Recursively searches the tree view in the tree to get an item container (RadTreeViewItem) for the particular data item.

Declaration

cs-api-definition
public RadTreeViewItem ContainerFromItemRecursive(object item)

Parameters

item

object

Returns

RadTreeViewItem

CreateDragVisualContent(IList<object>)

Creates default drag visual content - snapshot of all dragged items. Override this method in subclass in order to change the default drag visual content.

Declaration

cs-api-definition
protected virtual object CreateDragVisualContent(IList<object> draggedItems)

Parameters

draggedItems

IList<object>

Returns

object

ExpandAll()

Expands all items recursively.

Declaration

cs-api-definition
public void ExpandAll()

Remarks

If a child item is not generated it will be expanded once it is generated.

ExpandItemByPath(string)

Expands to an item with a given path.

Declaration

cs-api-definition
public void ExpandItemByPath(string path)

Parameters

path

string

The path to an item.

ExpandItemByPath(string, string)

Expands to an item with a given path.

Declaration

cs-api-definition
public void ExpandItemByPath(string path, string separator)

Parameters

path

string

The path to an item.

separator

string

The separator for the path.

GetContainerForItemOverride()

Declaration

cs-api-definition
protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject

GetItemByPath(string)

Gets a item by specifying a path to it.

Declaration

cs-api-definition
public RadTreeViewItem GetItemByPath(string path)

Parameters

path

string

The path to the item.

Returns

RadTreeViewItem

The item if found.

GetItemByPath(string, string)

Gets a item by specifying a path to it.

Declaration

cs-api-definition
public RadTreeViewItem GetItemByPath(string path, string separator)

Parameters

path

string

The path to the item.

separator

string

The path separator.

Returns

RadTreeViewItem

The item if found.

HideBetweenItemsDragCue()

Hides the drag cue that appears when a drop between two items is possible.

Declaration

cs-api-definition
[Obsolete("This method will be removed. It is not intended for third party usage.", false)]
public void HideBetweenItemsDragCue()

IsItemItsOwnContainerOverride(object)

Declaration

cs-api-definition
protected override bool IsItemItsOwnContainerOverride(object item)

Parameters

item

object

Returns

bool

OnApplyTemplate()

Occurs when the template for the RadTreeView is applied, allowing for custom processing after the template has been applied.

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnCreateAutomationPeer()

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnDragEnded(RadTreeViewDragEndedEventArgs)

Raises the event.

Declaration

cs-api-definition
[Obsolete("This method will be removed. Use DragDropManager API to customize drag drop operations.", false)]
protected virtual void OnDragEnded(RadTreeViewDragEndedEventArgs e)

Parameters

e

RadTreeViewDragEndedEventArgs

The RadTreeViewDragEndedEventArgs instance containing the event data.

OnDragEnter(DragEventArgs)

Called when DragEnter Event is Raise.

Declaration

cs-api-definition
protected override void OnDragEnter(DragEventArgs e)

Parameters

e

DragEventArgs

Event args.

OnDragLeave(DragEventArgs)

Called when DragEnter Event is Raise.

Declaration

cs-api-definition
protected override void OnDragLeave(DragEventArgs e)

Parameters

e

DragEventArgs

Event args.

OnDragOverTree(DragOverTreeEventArgs)

Raises the event.

Declaration

cs-api-definition
[Obsolete("This method will be removed. Use DragDropManager API to customize drag drop operations.", false)]
protected virtual void OnDragOverTree(DragOverTreeEventArgs e)

Parameters

e

DragOverTreeEventArgs

The DragOverTreeEventArgs instance containing the event data.

OnDragStarted(RadTreeViewDragEventArgs)

Raises the event.

Declaration

cs-api-definition
[Obsolete("This method will be removed. Use DragDropManager API to customize drag drop operations.", false)]
protected virtual void OnDragStarted(RadTreeViewDragEventArgs e)

Parameters

e

RadTreeViewDragEventArgs

The RadTreeViewDragEventArgs instance containing the event data.

OnDrop(DragEventArgs)

Called when DragEnter Event is Raise.

Declaration

cs-api-definition
protected override void OnDrop(DragEventArgs e)

Parameters

e

DragEventArgs

Event args.

OnExpanderStyleChanged(Style, Style)

Propagates the changed expander style through tree's children. Called when the ExpanderStyleInherited property changes.

Declaration

cs-api-definition
protected virtual void OnExpanderStyleChanged(Style oldStyle, Style newStyle)

Parameters

oldStyle

Style

The old style.

newStyle

Style

The new style.

OnGotFocus(object, RoutedEventArgs)

Called when the TreeView or one of its items receive focus.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")]
protected virtual void OnGotFocus(object sender, RoutedEventArgs e)

Parameters

sender

object

The sender of the event.

e

RoutedEventArgs

The event arguments that will be passed to the GotFocus event.

OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Declaration

cs-api-definition
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)

Parameters

e

KeyboardFocusChangedEventArgs

OnInitialized(EventArgs)

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

OnItemPrepared(RadTreeViewItemPreparedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnItemPrepared(RadTreeViewItemPreparedEventArgs e)

Parameters

e

RadTreeViewItemPreparedEventArgs

The RadTreeViewDragEndedEventArgs instance containing the event data.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Declaration

cs-api-definition
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Parameters

e

NotifyCollectionChangedEventArgs

OnLostFocus(object, RoutedEventArgs)

Called when the TreeView or one of its items lose focus.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")]
protected virtual void OnLostFocus(object sender, RoutedEventArgs e)

Parameters

sender

object

The sender of the event.

e

RoutedEventArgs

The event arguments that are passed to the LostFocus event.

OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)

Declaration

cs-api-definition
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)

Parameters

e

KeyboardFocusChangedEventArgs

OnMouseLeftButtonDown(MouseButtonEventArgs)

Declaration

cs-api-definition
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Parameters

e

MouseButtonEventArgs

OnMouseWheel(MouseWheelEventArgs)

Declaration

cs-api-definition
protected override void OnMouseWheel(MouseWheelEventArgs e)

Parameters

e

MouseWheelEventArgs

OnPreviewDragEnded(RadTreeViewDragEndedEventArgs)

Raises the event.

Declaration

cs-api-definition
[Obsolete("This method will be removed. Use DragDropManager API to customize drag drop operations.", false)]
protected virtual bool OnPreviewDragEnded(RadTreeViewDragEndedEventArgs e)

Parameters

e

RadTreeViewDragEndedEventArgs

The RadTreeViewDragEndedEventArgs instance containing the event data.

Returns

bool

OnPreviewDragStarted(RadTreeViewDragEventArgs)

Raises the event.

Declaration

cs-api-definition
[Obsolete("This method will be removed. Use DragDropManager API to customize drag drop operations.", false)]
protected virtual bool OnPreviewDragStarted(RadTreeViewDragEventArgs e)

Parameters

e

RadTreeViewDragEventArgs

The RadTreeViewDragEventArgs instance containing the event data.

Returns

bool

OnPreviewSelectionChanged(SelectionChangedEventArgs)

This method is called when the PreviewSelectionChanged is raised.

Declaration

cs-api-definition
protected virtual bool OnPreviewSelectionChanged(SelectionChangedEventArgs e)

Parameters

e

SelectionChangedEventArgs

The event arguments with which the event will be called.

Returns

bool

Returns whether the event was handled.

Remarks

Not calling the base method in overrides means that the PreviewSelectionChanged event will not be raised.

OnSelectionChanged(SelectionChangedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)

Parameters

e

SelectionChangedEventArgs

The SelectionChangedEventArgs instance containing the event data.

OnTextInput(TextCompositionEventArgs)

Declaration

cs-api-definition
protected override void OnTextInput(TextCompositionEventArgs e)

Parameters

e

TextCompositionEventArgs

PrepareContainerForItemOverride(DependencyObject, object)

Declaration

cs-api-definition
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)

Parameters

element

DependencyObject

item

object

ResetTheme()

Resets the theme.

Declaration

cs-api-definition
public void ResetTheme()

SelectItemByPath(string)

Adds the item with the given path to the collection of selected items. The path separator is "".

Declaration

cs-api-definition
public void SelectItemByPath(string path)

Parameters

path

string

A unique path for the item, normally made up of IDs.

SelectItemByPath(string, string)

Adds the item with the given path to the collection of selected items. The path separator is "".

Declaration

cs-api-definition
public void SelectItemByPath(string path, string separator)

Parameters

path

string

A unique path for the item, normally made up of IDs.

separator

string

The string separating the path elements, for example "".

ShowBetweenItemsDragCue(RadTreeViewItem)

Shows the DragCue that appears when a drop between two items is possible.

Declaration

cs-api-definition
[Obsolete("This method will be removed. It is not intended for third party usage.", false)]
public void ShowBetweenItemsDragCue(RadTreeViewItem dropDestination)

Parameters

dropDestination

RadTreeViewItem

The relative drop position. In this method only DropPosition.Before and DropPosition.After make sense.

UpdateDropPreviewLine(RadTreeViewItem, DropPosition)

Updates the drop preview line position and visibility while dragging.

Declaration

cs-api-definition
public void UpdateDropPreviewLine(RadTreeViewItem dropDestination, DropPosition dropPosition)

Parameters

dropDestination

RadTreeViewItem

dropPosition

DropPosition

Events

Checked

Occurs when a child TreeView item has been checked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Checked

Event Value

EventHandler<RadRoutedEventArgs>

Collapsed

Occurs when a child TreeView item has been collapsed.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Collapsed

Event Value

EventHandler<RadRoutedEventArgs>

DragEnded

Occurs when the drag has ended.

Declaration

cs-api-definition
[Obsolete("This event will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public event RadTreeViewDragEndedEventHandler DragEnded

Event Value

RadTreeViewDragEndedEventHandler

DragOverTree

Occurs when the dragging over the tree view.

Declaration

cs-api-definition
[Obsolete("This event will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public event DragOverTreeEventHandler DragOverTree

Event Value

DragOverTreeEventHandler

DragStarted

Occurs when the drag has started.

Declaration

cs-api-definition
[Obsolete("This event will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public event RadTreeViewDragEventHandler DragStarted

Event Value

RadTreeViewDragEventHandler

EditCanceled

Raised when item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.EditCanceled routed event.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler EditCanceled

Event Value

RadTreeViewItemEditedEventHandler

EditStarted

Raised when the edit of an item has just started. This is a wrapper for the EditableHeaderedItemsControl.EditStarted routed event.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler EditStarted

Event Value

RadTreeViewItemEditedEventHandler

Edited

Raised when the edit of an item has been committed.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler Edited

Event Value

RadTreeViewItemEditedEventHandler

Expanded

Occurs when a child TreeView item has been expanded.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Expanded

Event Value

EventHandler<RadRoutedEventArgs>

ItemClick

Occurs when a child TreeView item has been clicked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> ItemClick

Event Value

EventHandler<RadRoutedEventArgs>

ItemDoubleClick

Occurs when a child TreeView item has been double clicked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> ItemDoubleClick

Event Value

EventHandler<RadRoutedEventArgs>

ItemPrepared

Occurs when a child RadTreeViewItem has been prepared and is ready for use.

Declaration

cs-api-definition
public event EventHandler<RadTreeViewItemPreparedEventArgs> ItemPrepared

Event Value

EventHandler<RadTreeViewItemPreparedEventArgs>

Remarks

Use it to perform binding of RadTreeViewItem properties to the data objects.

LoadOnDemand

Occurs when a child TreeView item is loading its child items on demand. See the IsLoadOnDemandEnabled property.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> LoadOnDemand

Event Value

EventHandler<RadRoutedEventArgs>

PreviewChecked

Occurs before a child TreeView item is checked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewChecked

Event Value

EventHandler<RadRoutedEventArgs>

PreviewCollapsed

Occurs before a child TreeView item is collapsed.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewCollapsed

Event Value

EventHandler<RadRoutedEventArgs>

PreviewDragEnded

Occurs before the drag has been ended.

Declaration

cs-api-definition
[Obsolete("This event will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public event RadTreeViewDragEndedEventHandler PreviewDragEnded

Event Value

RadTreeViewDragEndedEventHandler

PreviewDragStarted

Occurs before the drag is started.

Declaration

cs-api-definition
[Obsolete("This event will be removed. Use DragDropManager API to customize drag drop operations.", false)]
public event RadTreeViewDragEventHandler PreviewDragStarted

Event Value

RadTreeViewDragEventHandler

PreviewEditCanceled

Raised just before item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditCanceled routed event.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler PreviewEditCanceled

Event Value

RadTreeViewItemEditedEventHandler

PreviewEditStarted

Raised just before editing of an item has started. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditStarted routed event.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler PreviewEditStarted

Event Value

RadTreeViewItemEditedEventHandler

PreviewEdited

Occurs before a TreeView item to accept the new Edited data.

Declaration

cs-api-definition
public event RadTreeViewItemEditedEventHandler PreviewEdited

Event Value

RadTreeViewItemEditedEventHandler

PreviewExpanded

Occurs before a child TreeView item is expanded.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewExpanded

Event Value

EventHandler<RadRoutedEventArgs>

PreviewSelected

Occurs before a child tree view item is selected.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewSelected

Event Value

EventHandler<RadRoutedEventArgs>

PreviewSelectionChanged

Raised just before the selected items collection has changed.

Declaration

cs-api-definition
public event SelectionChangedEventHandler PreviewSelectionChanged

Event Value

SelectionChangedEventHandler

PreviewUnchecked

Occurs before a child TreeView item is unchecked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewUnchecked

Event Value

EventHandler<RadRoutedEventArgs>

PreviewUnselected

Occurs before a child tree view item is unselected.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> PreviewUnselected

Event Value

EventHandler<RadRoutedEventArgs>

Selected

Occurs when a child RadTreeView item has been selected.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Selected

Event Value

EventHandler<RadRoutedEventArgs>

SelectionChanged

Occurs after the value of the SelectedItems property of a tree is changed.

Declaration

cs-api-definition
public event SelectionChangedEventHandler SelectionChanged

Event Value

SelectionChangedEventHandler

Unchecked

Occurs when a child TreeView item has been unchecked.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Unchecked

Event Value

EventHandler<RadRoutedEventArgs>

Unselected

Occurs when a child tree view item has been unselected.

Declaration

cs-api-definition
public event EventHandler<RadRoutedEventArgs> Unselected

Event Value

EventHandler<RadRoutedEventArgs>

In this article
DefinitionConstructorsRadTreeView()FieldsAutoScrollToSelectedItemPropertyBringIntoViewModePropertyCheckedItemsPropertyDragEndedEventDragOverTreeEventDragStartedEventDropExpandDelayPropertyExpanderStylePropertyImagesBaseDirPropertyIsDragDropEnabledPropertyIsDragPreviewEnabledPropertyIsDragTooltipEnabledPropertyIsDropPreviewLineEnabledPropertyIsEditablePropertyIsExpandOnDblClickEnabledPropertyIsExpandOnSingleClickEnabledPropertyIsLineEnabledPropertyIsLoadOnDemandEnabledPropertyIsOptionElementsEnabledPropertyIsRootLinesEnabledPropertyIsSingleExpandPathPropertyIsTriStateModePropertyItemEditTemplatePropertyItemEditTemplateSelectorPropertyItemsIndentPropertyPathSeparatorPropertyPerformSelectionOnMouseUpPropertyPreviewDragEndedEventPreviewDragStartedEventPreviewSelectionChangedEventSelectedContainerPropertySelectedItemPropertySelectedItemsPropertySelectedValuePathPropertySelectedValuePropertySelectionChangedEventSelectionModePropertyTextDropAfterPropertyTextDropBeforePropertyTextDropInPropertyTextDropRootPropertyTextSearchModePropertyPropertiesAutoScrollToSelectedItemBringIntoViewModeCheckedItemsDropExpandDelayExpanderStyleImagesBaseDirIsDragDropEnabledIsDragPreviewEnabledIsDragTooltipEnabledIsDropPreviewLineEnabledIsEditableIsEditingIsExpandOnDblClickEnabledIsExpandOnSingleClickEnabledIsLineEnabledIsLoadOnDemandEnabledIsOptionElementsEnabledIsRootLinesEnabledIsSingleExpandPathIsTriStateModeIsVirtualizingItemEditTemplateItemEditTemplateSelectorItemsIndentPathSeparatorPerformSelectionOnMouseUpScrollViewerSelectedContainerSelectedItemSelectedItemsSelectedValueSelectedValuePathSelectionModeTextDropAfterTextDropBeforeTextDropInTextDropRootTextSearchModeMethodsAddItemByPath(string)AddItemByPath(string, string)AddItemsByPath(string, string)BringIndexIntoView(int)BringIndexIntoView(int, Point)BringItemIntoView(object)BringItemIntoView(object, Point)BringPathIntoView(string)BringPathIntoView(string, Point)ChangeVisualState(bool)ClearContainerForItemOverride(DependencyObject, object)CollapseAll()ContainerFromItemRecursive(object)CreateDragVisualContent(IList<object>)ExpandAll()ExpandItemByPath(string)ExpandItemByPath(string, string)GetContainerForItemOverride()GetItemByPath(string)GetItemByPath(string, string)HideBetweenItemsDragCue()IsItemItsOwnContainerOverride(object)OnApplyTemplate()OnCreateAutomationPeer()OnDragEnded(RadTreeViewDragEndedEventArgs)OnDragEnter(DragEventArgs)OnDragLeave(DragEventArgs)OnDragOverTree(DragOverTreeEventArgs)OnDragStarted(RadTreeViewDragEventArgs)OnDrop(DragEventArgs)OnExpanderStyleChanged(Style, Style)OnGotFocus(object, RoutedEventArgs)OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)OnInitialized(EventArgs)OnItemPrepared(RadTreeViewItemPreparedEventArgs)OnItemsChanged(NotifyCollectionChangedEventArgs)OnLostFocus(object, RoutedEventArgs)OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)OnMouseLeftButtonDown(MouseButtonEventArgs)OnMouseWheel(MouseWheelEventArgs)OnPreviewDragEnded(RadTreeViewDragEndedEventArgs)OnPreviewDragStarted(RadTreeViewDragEventArgs)OnPreviewSelectionChanged(SelectionChangedEventArgs)OnSelectionChanged(SelectionChangedEventArgs)OnTextInput(TextCompositionEventArgs)PrepareContainerForItemOverride(DependencyObject, object)ResetTheme()SelectItemByPath(string)SelectItemByPath(string, string)ShowBetweenItemsDragCue(RadTreeViewItem)UpdateDropPreviewLine(RadTreeViewItem, DropPosition)EventsCheckedCollapsedDragEndedDragOverTreeDragStartedEditCanceledEditStartedEditedExpandedItemClickItemDoubleClickItemPreparedLoadOnDemandPreviewCheckedPreviewCollapsedPreviewDragEndedPreviewDragStartedPreviewEditCanceledPreviewEditStartedPreviewEditedPreviewExpandedPreviewSelectedPreviewSelectionChangedPreviewUncheckedPreviewUnselectedSelectedSelectionChangedUncheckedUnselected
Not finding the help you need?
Contact Support