Class RadTreeView
A hierarchical control used to display a tree of items.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
[TelerikToolboxCategory("Navigation")]
public class RadTreeView : ItemsControl, IScrollingServiceCore, IScrollingInfo
Remarks
The RadTreeView control is used to display a list of items. The RadTreeView control supports the following features:
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.
Constructors
RadTreeView()
Initializes a new instance of the RadTreeView class.
Declaration
public RadTreeView()
Remarks
Use this constructor to create and initialize a new instance of the RadTreeView control.
Fields
AutoScrollToSelectedItemProperty
Identifies the AutoScrollToSelectedItem property.
Declaration
public static readonly DependencyProperty AutoScrollToSelectedItemProperty
Field Value
System.Windows.DependencyProperty
|
BringIntoViewModeProperty
Identifies the BringIntoView property.
Declaration
public static readonly DependencyProperty BringIntoViewModeProperty
Field Value
System.Windows.DependencyProperty
|
CheckedItemsProperty
Identifies the CheckedItemsProperty dependency property.
Declaration
public static readonly DependencyProperty CheckedItemsProperty
Field Value
System.Windows.DependencyProperty
|
DragEndedEvent
Identifies the DragEnded routed event.
Declaration
public static readonly RoutedEvent DragEndedEvent
Field Value
RoutedEvent
|
DragOverTreeEvent
Identifies the DragOverTree routed event.
Declaration
public static readonly RoutedEvent DragOverTreeEvent
Field Value
RoutedEvent
|
DragStartedEvent
Identifies the DragStarted routed event.
Declaration
public static readonly RoutedEvent DragStartedEvent
Field Value
RoutedEvent
|
DropExpandDelayProperty
Identifies the DropExpandDelay property.
Declaration
public static readonly DependencyProperty DropExpandDelayProperty
Field Value
System.Windows.DependencyProperty
|
ExpanderStyleProperty
Identifies the ExpanderStyle dependency property.
Declaration
public static readonly DependencyProperty ExpanderStyleProperty
Field Value
System.Windows.DependencyProperty
|
ImagesBaseDirProperty
Identifies the ImagesBaseDirectory dependency property.
Declaration
public static readonly DependencyProperty ImagesBaseDirProperty
Field Value
System.Windows.DependencyProperty
|
IsDragDropEnabledProperty
Identifies the IsDragDropEnabled dependency property.
Declaration
public static readonly DependencyProperty IsDragDropEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsDragPreviewEnabledProperty
Identifies the IsDragPreviewEnabled dependency property.
Declaration
public static readonly DependencyProperty IsDragPreviewEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsDragTooltipEnabledProperty
Identifies the IsDragTooltipEnabled dependency property.
Declaration
public static readonly DependencyProperty IsDragTooltipEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsDropPreviewLineEnabledProperty
Identifies the IsDropPreviewLineEnabled dependency property.
Declaration
public static readonly DependencyProperty IsDropPreviewLineEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsEditableProperty
Identifies the IsEditable dependency property.
Declaration
public static readonly DependencyProperty IsEditableProperty
Field Value
System.Windows.DependencyProperty
|
IsExpandOnDblClickEnabledProperty
Identifies the IsExpandOnDoubleClickEnabled dependency property.
Declaration
public static readonly DependencyProperty IsExpandOnDblClickEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsExpandOnSingleClickEnabledProperty
Identifies the IsExpandOnSingleClickEnabled dependency property.
Declaration
public static readonly DependencyProperty IsExpandOnSingleClickEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsLineEnabledProperty
Identifies the IsLineEnabled dependency property.
Declaration
public static readonly DependencyProperty IsLineEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsLoadOnDemandEnabledProperty
Identifies the IsLoadOnDemandEnabled dependency property.
Declaration
public static readonly DependencyProperty IsLoadOnDemandEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsOptionElementsEnabledProperty
Identifies the IsOptionElementsEnabled dependency property.
Declaration
public static readonly DependencyProperty IsOptionElementsEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsRootLinesEnabledProperty
Identifies the IsRootLinesEnabled dependency property.
Declaration
public static readonly DependencyProperty IsRootLinesEnabledProperty
Field Value
System.Windows.DependencyProperty
|
IsSingleExpandPathProperty
Identifies the IsSingleExpandPath dependency property.
Declaration
public static readonly DependencyProperty IsSingleExpandPathProperty
Field Value
System.Windows.DependencyProperty
|
IsTriStateModeProperty
Identifies the IsTriStateMode dependency property.
Declaration
public static readonly DependencyProperty IsTriStateModeProperty
Field Value
System.Windows.DependencyProperty
|
ItemEditTemplateProperty
Identifies the ItemEditTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemEditTemplateProperty
Field Value
System.Windows.DependencyProperty
|
ItemEditTemplateSelectorProperty
Identifies the ItemEditTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ItemEditTemplateSelectorProperty
Field Value
System.Windows.DependencyProperty
|
ItemsIndentProperty
Identifies the ItemsIndent dependency property.
Declaration
public static readonly DependencyProperty ItemsIndentProperty
Field Value
System.Windows.DependencyProperty
|
PathSeparatorProperty
Identifies the PathSeparator dependency property.
Declaration
public static readonly DependencyProperty PathSeparatorProperty
Field Value
System.Windows.DependencyProperty
|
PreviewDragEndedEvent
Identifies the PreviewDragEnded routed event.
Declaration
public static readonly RoutedEvent PreviewDragEndedEvent
Field Value
RoutedEvent
|
PreviewDragStartedEvent
Identifies the PreviewDragStarted routed event.
Declaration
public static readonly RoutedEvent PreviewDragStartedEvent
Field Value
RoutedEvent
|
PreviewSelectionChangedEvent
Identifies the PreviewSelectionChanged routed event.
Declaration
public static readonly RoutedEvent PreviewSelectionChangedEvent
Field Value
RoutedEvent
|
SelectedContainerProperty
Identifies the SelectedContainer property.
Declaration
public static readonly DependencyProperty SelectedContainerProperty
Field Value
System.Windows.DependencyProperty
|
SelectedItemProperty
Identifies the SelectedItem property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
System.Windows.DependencyProperty
|
SelectedItemsProperty
Identifies the SelectedItemsProperty dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
System.Windows.DependencyProperty
|
SelectedValuePathProperty
Identifies the SelectedValuePath dependency property.
Declaration
public static readonly DependencyProperty SelectedValuePathProperty
Field Value
System.Windows.DependencyProperty
|
SelectedValueProperty
Identifies the SelectedValue dependency property.
Declaration
public static readonly DependencyProperty SelectedValueProperty
Field Value
System.Windows.DependencyProperty
|
SelectionChangedEvent
Identifies the SelectionChanged routed event.
Declaration
public static readonly RoutedEvent SelectionChangedEvent
Field Value
RoutedEvent
|
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
System.Windows.DependencyProperty
|
TextDropAfterProperty
Identifies the TextDropAfter dependency property.
Declaration
public static readonly DependencyProperty TextDropAfterProperty
Field Value
System.Windows.DependencyProperty
|
TextDropBeforeProperty
Identifies the TextDropBefore dependency property.
Declaration
public static readonly DependencyProperty TextDropBeforeProperty
Field Value
System.Windows.DependencyProperty
|
TextDropInProperty
Identifies the TextDropIn dependency property.
Declaration
public static readonly DependencyProperty TextDropInProperty
Field Value
System.Windows.DependencyProperty
|
TextDropRootProperty
Identifies the TextDropRoot dependency property.
Declaration
public static readonly DependencyProperty TextDropRootProperty
Field Value
System.Windows.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
public bool AutoScrollToSelectedItem { get; set; }
Property Value
System.Boolean
|
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
public BringIntoViewMode BringIntoViewMode { get; set; }
Property Value
BringIntoViewMode
|
CheckedItems
Gets a collection containing the items that are currently checked.
Declaration
public ICollection<object> CheckedItems { get; }
Property Value
System.Collections.Generic.ICollection<System.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
public TimeSpan DropExpandDelay { get; set; }
Property Value
System.TimeSpan
|
ExpanderStyle
Gets or sets the style of RadTreeViewItem expander button.
Declaration
public Style ExpanderStyle { get; set; }
Property Value
System.Windows.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.
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
ExpanderStyleInherited="{StaticResource MyExpanderStyle}"/>
ImagesBaseDir
Gets or sets the directory where image files used for the TreeView images.
Declaration
public string ImagesBaseDir { get; set; }
Property Value
System.String
|
IsDragDropEnabled
Gets or sets a value indicating whether drag and drop is enabled.
Declaration
public bool IsDragDropEnabled { get; set; }
Property Value
System.Boolean
|
IsDragPreviewEnabled
Gets or sets a value indicating whether drag feedback is shown while dragging.
Declaration
public bool IsDragPreviewEnabled { get; set; }
Property Value
System.Boolean
|
IsDragTooltipEnabled
Gets or sets a value indicating whether drag tooltip is shown while dragging.
Declaration
public bool IsDragTooltipEnabled { get; set; }
Property Value
System.Boolean
|
IsDropPreviewLineEnabled
Gets or sets a value indicating whether drag outline is shown while dragging.
Declaration
public bool IsDropPreviewLineEnabled { get; set; }
Property Value
System.Boolean
|
IsEditable
Gets or sets a value indicating whether the user can edit the TreeViewItems.
Declaration
public bool IsEditable { get; set; }
Property Value
System.Boolean
|
IsEditing
Gets if there is an open editor in the tree view.
Declaration
public virtual bool IsEditing { get; }
Property Value
System.Boolean
|
IsExpandOnDblClickEnabled
Gets or sets a value whether the item will toggle its expand state on double click.
Declaration
public bool IsExpandOnDblClickEnabled { get; set; }
Property Value
System.Boolean
|
IsExpandOnSingleClickEnabled
Gets or sets a value indicating whether the item will toggle its expand state on single click.
Declaration
public bool IsExpandOnSingleClickEnabled { get; set; }
Property Value
System.Boolean
|
IsLineEnabled
Gets or sets a value indicating whether connecting lines are displayed.
Declaration
public bool IsLineEnabled { get; set; }
Property Value
System.Boolean
|
IsLoaded
Gets a value determine whether the Loaded event has been fired or not.
Declaration
public bool IsLoaded { get; }
Property Value
System.Boolean
Returns true if loaded event has been rised. |
IsLoadOnDemandEnabled
Gets or sets a value indicating whether loading on demand is enabled.
Declaration
public bool IsLoadOnDemandEnabled { get; set; }
Property Value
System.Boolean
|
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 LoadOnDemand 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
public bool IsOptionElementsEnabled { get; set; }
Property Value
System.Boolean
|
IsRootLinesEnabled
Gets or sets a value indicating whether lines are displayed next to root item.
Declaration
public bool IsRootLinesEnabled { get; set; }
Property Value
System.Boolean
|
IsSingleExpandPath
Gets a value indicating whether only one branch of the TreeView will be expanded.
Declaration
public bool IsSingleExpandPath { get; set; }
Property Value
System.Boolean
|
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
public bool IsTriStateMode { get; set; }
Property Value
System.Boolean
|
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
public bool IsVirtualizing { get; set; }
Property Value
System.Boolean
|
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
public DataTemplate ItemEditTemplate { get; set; }
Property Value
System.Windows.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
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
public int ItemsIndent { get; set; }
Property Value
System.Int32
|
PathSeparator
Gets or sets the delimiter string that the tree item path uses.
Declaration
public string PathSeparator { get; set; }
Property Value
System.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 ().
ScrollViewer
Gets the ScrollViewer control the is inside the RadTreeView.
Declaration
public ScrollViewer ScrollViewer { get; }
Property Value
System.Windows.Controls.ScrollViewer
|
Remarks
Use the ScrollViewer.HorizontalScrollBarVisibility and ScrollViewer.VerticalScrollBarVisibility attached properties to set the visibility of the ScrollBars.
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
ms:ScrollViewer.HorizontalScrollBarVisibility="Visible"
ms:ScrollViewer.VerticalScrollBarVisibility="Visible"/>
SelectedContainer
Gets the TreeViewItem container that is currently selected. This is a dependency property.
Declaration
public RadTreeViewItem SelectedContainer { get; }
Property Value
RadTreeViewItem
|
SelectedItem
Gets or sets the item that is currently selected. This is a dependency property.
Declaration
public object SelectedItem { get; set; }
Property Value
System.Object
|
SelectedItems
Gets a collection containing the items that are currently selected.
Declaration
public ObservableCollection<object> SelectedItems { get; }
Property Value
System.Collections.ObjectModel.ObservableCollection<System.Object>
|
SelectedValue
Gets or sets the value of the SelectedItem, obtained by using SelectedValuePath.
Declaration
public object SelectedValue { get; }
Property Value
System.Object
|
SelectedValuePath
Gets or sets the path that is used to extract the SelectedValue from the SelectedItem.
Declaration
public string SelectedValuePath { get; set; }
Property Value
System.String
|
SelectionMode
Gets or sets the selection mode.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
SelectionMode
|
TextDropAfter
Gets or sets the text "Drop after" text of the drag preview.
Declaration
public string TextDropAfter { get; set; }
Property Value
System.String
The text drop after. |
TextDropBefore
Gets or sets the text "Drop before" text of the drag preview.
Declaration
public string TextDropBefore { get; set; }
Property Value
System.String
The text drop before. |
TextDropIn
Gets or sets the text for "Drop in" text of the drag preview.
Declaration
public string TextDropIn { get; set; }
Property Value
System.String
The text drop in. |
TextDropRoot
Gets or sets the text that appears when an item is dropped in an empty TreeView.
Declaration
public string TextDropRoot { get; set; }
Property Value
System.String
The text drop in. |
Methods
add_DragEnded(RadTreeViewDragEndedEventHandler)
Declaration
public void add_DragEnded(RadTreeViewDragEndedEventHandler value)
Parameters
RadTreeViewDragEndedEventHandler
value
|
add_DragOverTree(DragOverTreeEventHandler)
Declaration
public void add_DragOverTree(DragOverTreeEventHandler value)
Parameters
DragOverTreeEventHandler
value
|
add_DragStarted(RadTreeViewDragEventHandler)
Declaration
public void add_DragStarted(RadTreeViewDragEventHandler value)
Parameters
RadTreeViewDragEventHandler
value
|
add_EditCanceled(RadTreeViewItemEditedEventHandler)
Declaration
public void add_EditCanceled(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_Edited(RadTreeViewItemEditedEventHandler)
Declaration
public void add_Edited(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_EditStarted(RadTreeViewItemEditedEventHandler)
Declaration
public void add_EditStarted(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_PreviewDragEnded(RadTreeViewDragEndedEventHandler)
Declaration
public void add_PreviewDragEnded(RadTreeViewDragEndedEventHandler value)
Parameters
RadTreeViewDragEndedEventHandler
value
|
add_PreviewDragStarted(RadTreeViewDragEventHandler)
Declaration
public void add_PreviewDragStarted(RadTreeViewDragEventHandler value)
Parameters
RadTreeViewDragEventHandler
value
|
add_PreviewEditCanceled(RadTreeViewItemEditedEventHandler)
Declaration
public void add_PreviewEditCanceled(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_PreviewEdited(RadTreeViewItemEditedEventHandler)
Declaration
public void add_PreviewEdited(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_PreviewEditStarted(RadTreeViewItemEditedEventHandler)
Declaration
public void add_PreviewEditStarted(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
add_PreviewSelectionChanged(SelectionChangedEventHandler)
Declaration
public void add_PreviewSelectionChanged(SelectionChangedEventHandler value)
Parameters
SelectionChangedEventHandler
value
|
add_SelectionChanged(SelectionChangedEventHandler)
Declaration
public void add_SelectionChanged(SelectionChangedEventHandler value)
Parameters
SelectionChangedEventHandler
value
|
AddItemByPath(String)
Creates a new item and adds a item by path. Can be used if the TreeView is not data bound.
Declaration
public RadTreeViewItem AddItemByPath(string path)
Parameters
System.String
path
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
public RadTreeViewItem AddItemByPath(string path, string separator)
Parameters
System.String
path
Where the item should be added. |
System.String
separator
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
public RadTreeViewItem AddItemsByPath(string path, string separator)
Parameters
System.String
path
The path to create an item at. |
System.String
separator
The path separator. |
Returns
RadTreeViewItem
The newly created RadTreeViewItem. |
BringIndexIntoView(Int32)
Brings the item with the given index into view. The method will not work before the item containers have been generated.
Declaration
public void BringIndexIntoView(int index)
Parameters
System.Int32
index
The index of the item to be brought into view. |
BringIndexIntoView(Int32, Point)
Brings the item with the given index into view. The method will not work before the item containers have been generated.
Declaration
public void BringIndexIntoView(int index, Point offset)
Parameters
System.Int32
index
The index of the item to be brought into view. |
System.Windows.Point
offset
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
public void BringItemIntoView(object item)
Parameters
System.Object
item
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
public void BringItemIntoView(object item, Point offset)
Parameters
System.Object
item
The item to be brought into view. |
System.Windows.Point
offset
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
public void BringPathIntoView(string path)
Parameters
System.String
path
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
public void BringPathIntoView(string path, Point offset)
Parameters
System.String
path
The path of the item to be brought into view. |
System.Windows.Point
offset
The offset from the top left corner of the tree where the item will be scrolled to. |
ClearContainerForItemOverride(DependencyObject, Object)
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
|
System.Object
item
|
CollapseAll()
Collapses all items recursively.
Declaration
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
public RadTreeViewItem ContainerFromItemRecursive(object item)
Parameters
System.Object
item
|
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
protected virtual object CreateDragVisualContent(IList<object> draggedItems)
Parameters
System.Collections.Generic.IList<System.Object>
draggedItems
|
Returns
System.Object
|
ExpandAll()
Expands all items recursively.
Declaration
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
public void ExpandItemByPath(string path)
Parameters
System.String
path
The path to an item. |
ExpandItemByPath(String, String)
Expands to an item with a given path.
Declaration
public void ExpandItemByPath(string path, string separator)
Parameters
System.String
path
The path to an item. |
System.String
separator
The separator for the path. |
GetContainerForItemOverride()
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
System.Windows.DependencyObject
|
GetItemByPath(String)
Gets a item by specifying a path to it.
Declaration
public RadTreeViewItem GetItemByPath(string path)
Parameters
System.String
path
The path to the item. |
Returns
RadTreeViewItem
The item if found. |
GetItemByPath(String, String)
Gets a item by specifying a path to it.
Declaration
public RadTreeViewItem GetItemByPath(string path, string separator)
Parameters
System.String
path
The path to the item. |
System.String
separator
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
public void HideBetweenItemsDragCue()
IsItemItsOwnContainerOverride(Object)
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
System.Object
item
|
Returns
System.Boolean
|
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
Overrides
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer
|
OnDragEnded(RadTreeViewDragEndedEventArgs)
Raises the DragEnded event.
Declaration
protected virtual void OnDragEnded(RadTreeViewDragEndedEventArgs e)
Parameters
RadTreeViewDragEndedEventArgs
e
The RadTreeViewDragEndedEventArgs instance containing the event data. |
OnDragEnter(DragEventArgs)
Called when DragEnter Event is Raise.
Declaration
protected override void OnDragEnter(DragEventArgs e)
Parameters
System.Windows.DragEventArgs
e
Event args. |
OnDragLeave(DragEventArgs)
Called when DragEnter Event is Raise.
Declaration
protected override void OnDragLeave(DragEventArgs e)
Parameters
System.Windows.DragEventArgs
e
Event args. |
OnDragOverTree(DragOverTreeEventArgs)
Raises the DragOverTree event.
Declaration
protected virtual void OnDragOverTree(DragOverTreeEventArgs e)
Parameters
DragOverTreeEventArgs
e
The DragOverTreeEventArgs instance containing the event data. |
OnDragStarted(RadTreeViewDragEventArgs)
Raises the DragStarted event.
Declaration
protected virtual void OnDragStarted(RadTreeViewDragEventArgs e)
Parameters
RadTreeViewDragEventArgs
e
The RadTreeViewDragEventArgs instance containing the event data. |
OnDrop(DragEventArgs)
Called when DragEnter Event is Raise.
Declaration
protected override void OnDrop(DragEventArgs e)
Parameters
System.Windows.DragEventArgs
e
Event args. |
OnExpanderStyleChanged(Style, Style)
Propagates the changed expander style through tree's children. Called when the ExpanderStyleInherited property changes.
Declaration
protected virtual void OnExpanderStyleChanged(Style oldStyle, Style newStyle)
Parameters
System.Windows.Style
oldStyle
The old style. |
System.Windows.Style
newStyle
The new style. |
OnGotFocus(Object, RoutedEventArgs)
Called when the TreeView or one of its items receive focus.
Declaration
protected virtual void OnGotFocus(object sender, RoutedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
System.Windows.RoutedEventArgs
e
The event arguments that will be passed to the GotFocus event. |
OnItemPrepared(RadTreeViewItemPreparedEventArgs)
Raises the DragEnded event.
Declaration
protected virtual void OnItemPrepared(RadTreeViewItemPreparedEventArgs e)
Parameters
RadTreeViewItemPreparedEventArgs
e
The RadTreeViewDragEndedEventArgs instance containing the event data. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
System.Collections.Specialized.NotifyCollectionChangedEventArgs
e
A System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains the event data. |
Overrides
OnLostFocus(Object, RoutedEventArgs)
Called when the TreeView or one of its items lose focus.
Declaration
protected virtual void OnLostFocus(object sender, RoutedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
System.Windows.RoutedEventArgs
e
The event arguments that are passed to the LostFocus event. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
System.Windows.Input.MouseButtonEventArgs
e
|
OnMouseWheel(MouseWheelEventArgs)
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
System.Windows.Input.MouseWheelEventArgs
e
|
OnPreviewDragEnded(RadTreeViewDragEndedEventArgs)
Raises the PreviewDragEnded event.
Declaration
protected virtual bool OnPreviewDragEnded(RadTreeViewDragEndedEventArgs e)
Parameters
RadTreeViewDragEndedEventArgs
e
The RadTreeViewDragEndedEventArgs instance containing the event data. |
Returns
System.Boolean
|
OnPreviewDragStarted(RadTreeViewDragEventArgs)
Raises the PreviewDragStarted event.
Declaration
protected virtual bool OnPreviewDragStarted(RadTreeViewDragEventArgs e)
Parameters
RadTreeViewDragEventArgs
e
The RadTreeViewDragEventArgs instance containing the event data. |
Returns
System.Boolean
|
OnPreviewSelectionChanged(SelectionChangedEventArgs)
This method is called when the PreviewSelectionChanged is raised.
Declaration
protected virtual bool OnPreviewSelectionChanged(SelectionChangedEventArgs e)
Parameters
SelectionChangedEventArgs
e
The event arguments with which the event will be called. |
Returns
System.Boolean
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 SelectionChanged event.
Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
SelectionChangedEventArgs
e
The SelectionChangedEventArgs instance containing the event data. |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
System.Windows.DependencyObject
element
Element used to display the specified item. |
System.Object
item
Specified item. |
Overrides
remove_DragEnded(RadTreeViewDragEndedEventHandler)
Declaration
public void remove_DragEnded(RadTreeViewDragEndedEventHandler value)
Parameters
RadTreeViewDragEndedEventHandler
value
|
remove_DragOverTree(DragOverTreeEventHandler)
Declaration
public void remove_DragOverTree(DragOverTreeEventHandler value)
Parameters
DragOverTreeEventHandler
value
|
remove_DragStarted(RadTreeViewDragEventHandler)
Declaration
public void remove_DragStarted(RadTreeViewDragEventHandler value)
Parameters
RadTreeViewDragEventHandler
value
|
remove_EditCanceled(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_EditCanceled(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_Edited(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_Edited(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_EditStarted(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_EditStarted(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_PreviewDragEnded(RadTreeViewDragEndedEventHandler)
Declaration
public void remove_PreviewDragEnded(RadTreeViewDragEndedEventHandler value)
Parameters
RadTreeViewDragEndedEventHandler
value
|
remove_PreviewDragStarted(RadTreeViewDragEventHandler)
Declaration
public void remove_PreviewDragStarted(RadTreeViewDragEventHandler value)
Parameters
RadTreeViewDragEventHandler
value
|
remove_PreviewEditCanceled(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_PreviewEditCanceled(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_PreviewEdited(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_PreviewEdited(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_PreviewEditStarted(RadTreeViewItemEditedEventHandler)
Declaration
public void remove_PreviewEditStarted(RadTreeViewItemEditedEventHandler value)
Parameters
RadTreeViewItemEditedEventHandler
value
|
remove_PreviewSelectionChanged(SelectionChangedEventHandler)
Declaration
public void remove_PreviewSelectionChanged(SelectionChangedEventHandler value)
Parameters
SelectionChangedEventHandler
value
|
remove_SelectionChanged(SelectionChangedEventHandler)
Declaration
public void remove_SelectionChanged(SelectionChangedEventHandler value)
Parameters
SelectionChangedEventHandler
value
|
SelectItemByPath(String)
Adds the item with the given path to the collection of selected items. The path separator is "".
Declaration
public void SelectItemByPath(string path)
Parameters
System.String
path
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
public void SelectItemByPath(string path, string separator)
Parameters
System.String
path
A unique path for the item, normally made up of IDs. |
System.String
separator
The string separating the path elements, for example "". |
ShowBetweenItemsDragCue(RadTreeViewItem)
Shows the DragCue that appears when a drop between two items is possible.
Declaration
public void ShowBetweenItemsDragCue(RadTreeViewItem dropDestination)
Parameters
RadTreeViewItem
dropDestination
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
public void UpdateDropPreviewLine(RadTreeViewItem dropDestination, DropPosition dropPosition)
Parameters
RadTreeViewItem
dropDestination
|
DropPosition
dropPosition
|
Events
Checked
Occurs when a child TreeView item has been checked.
Declaration
public event EventHandler<RadRoutedEventArgs> Checked
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Checked="RadTreeView1_Checked"/>
void RadTreeView1_Checked(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been checked
RadTreeViewItem checkedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
Collapsed
Occurs when a child TreeView item has been collapsed.
Declaration
public event EventHandler<RadRoutedEventArgs> Collapsed
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Collapsed="RadTreeView1_Collapsed"/>
void RadTreeView1_Collapsed(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been collapsed
RadTreeViewItem collapsedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
DragEnded
Occurs when the drag has ended.
Declaration
public event RadTreeViewDragEndedEventHandler DragEnded
Event Type
RadTreeViewDragEndedEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
DragEnded="RadTreeView1_DragEnded"/>
void private void RadTreeView1_DragEnded(object sender, RadTreeViewDragEventArgs e)
{
// get a reference to the items that has been dragged
Collection<object> draggedItems = e.DraggedItems;
}
DragOverTree
Occurs when the dragging over the tree view.
Declaration
public event DragOverTreeEventHandler DragOverTree
Event Type
DragOverTreeEventHandler
|
DragStarted
Occurs when the drag has started.
Declaration
public event RadTreeViewDragEventHandler DragStarted
Event Type
RadTreeViewDragEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
DragStarted="RadTreeView1_DragStarted"/>
void private void RadTreeView1_DragStarted(object sender, RadTreeViewDragEventArgs e)
{
// get a reference to the items that has been dragged
Collection<object> draggedItems = e.DraggedItems;
}
EditCanceled
Raised when item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.EditCanceled routed event.
Declaration
public event RadTreeViewItemEditedEventHandler EditCanceled
Event Type
RadTreeViewItemEditedEventHandler
|
Edited
Raised when the edit of an item has been committed.
Declaration
public event RadTreeViewItemEditedEventHandler Edited
Event Type
RadTreeViewItemEditedEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Edited="RadTreeView1_Edited"/>
void RadTreeView1_Edited(object sender, RadTreeViewItemEditedEventArgs e)
{
// get a reference to the item that has been edited
RadTreeViewItem editedItem = e.Source as RadTreeViewItem;
string newText = e.NewText;
string oldText = e.OldText;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
EditStarted
Raised when the edit of an item has just started. This is a wrapper for the EditableHeaderedItemsControl.EditStarted routed event.
Declaration
public event RadTreeViewItemEditedEventHandler EditStarted
Event Type
RadTreeViewItemEditedEventHandler
|
Expanded
Occurs when a child TreeView item has been expanded.
Declaration
public event EventHandler<RadRoutedEventArgs> Expanded
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Expanded="RadTreeView1_Expanded"/>
void RadTreeView1_Expanded(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been expanded
RadTreeViewItem expandedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
ItemClick
Occurs when a child TreeView item has been clicked.
Declaration
public event EventHandler<RadRoutedEventArgs> ItemClick
Event Type
System.EventHandler<RadRoutedEventArgs>
|
ItemDoubleClick
Occurs when a child TreeView item has been double clicked.
Declaration
public event EventHandler<RadRoutedEventArgs> ItemDoubleClick
Event Type
System.EventHandler<RadRoutedEventArgs>
|
ItemPrepared
Occurs when a child RadTreeViewItem has been prepared and is ready for use.
Declaration
public event EventHandler<RadTreeViewItemPreparedEventArgs> ItemPrepared
Event Type
System.EventHandler<RadTreeViewItemPreparedEventArgs>
|
Remarks
Use it to perform binding of RadTreeViewItem properties to the data objects.
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
ItemPrepared="RadTreeView1_ItemPrepared"/>
void RadTreeView1_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
{
// get a reference to the item that has been selected
RadTreeViewItem preparedItem = e.PreparedItem as RadTreeViewItem;
// do something with this item
preparedItem.IsSelected = (preparedItem.Item is MyCustomBussinesObject);
}
LoadOnDemand
Occurs when a child TreeView item is loading its child items on demand. See the IsLoadOnDemandEnabled property.
Declaration
public event EventHandler<RadRoutedEventArgs> LoadOnDemand
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
LoadOnDemand="RadTreeView1_LoadOnDemand"/>
void RadTreeView1_LoadOnDemand(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that is loading on demand
RadTreeViewItem loadOnDemandItem = e.Source as RadTreeViewItem;
// get the data for the new items
// from web services or from another data set
// of just create them declaratively like that:
RadTreeViewItem newItem = new RadTreeViewItem();
newItem.Header = "New Item";
// add the new item(s) as a childs of the item that is loading on demand
loadOnDemandItem.Items.Add(newItem);
// if there are not items to add you can skip the loading animation
// by setting the IsLoadingOnDemand property to false
loadOnDemandItem.IsLoadingOnDemand = false;
// if there are no items to add at this moment and you want to
// stop the LoadOnDemand event from firing again set
loadOnDemandItem.IsLoadOnDemandEnabled = false;
}
PreviewChecked
Occurs before a child TreeView item is checked.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewChecked
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewChecked="RadTreeView1_PreviewChecked"/>
void private void RadTreeView1_PreviewChecked(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be checked
RadTreeViewItem itemToCheck = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewCollapsed
Occurs before a child TreeView item is collapsed.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewCollapsed
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewCollapsed="RadTreeView1_PreviewCollapsed"/>
void private void RadTreeView1_PreviewCollapsed(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be collapsed
RadTreeViewItem itemToCollapse = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewDragEnded
Occurs before the drag has been ended.
Declaration
public event RadTreeViewDragEndedEventHandler PreviewDragEnded
Event Type
RadTreeViewDragEndedEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewDragEnded="RadTreeView1_PreviewDragEnded"/>
void private void RadTreeView1_PreviewDragEnded(object sender, RadTreeViewDragEventArgs e)
{
// get a reference to the items that has been dragged
Collection<object> draggedItems = e.DraggedItems;
}
PreviewDragStarted
Occurs before the drag is started.
Declaration
public event RadTreeViewDragEventHandler PreviewDragStarted
Event Type
RadTreeViewDragEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewDragStarted="RadTreeView1_PreviewDragStarted"/>
void private void RadTreeView1_PreviewDragStarted(object sender, RadTreeViewDragEventArgs e)
{
// get a reference to the items that has been dragged
Collection<object> draggedItems = e.DraggedItems;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewEditCanceled
Raised just before item editing has been canceled. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditCanceled routed event.
Declaration
public event RadTreeViewItemEditedEventHandler PreviewEditCanceled
Event Type
RadTreeViewItemEditedEventHandler
|
PreviewEdited
Occurs before a TreeView item to accept the new Edited data.
Declaration
public event RadTreeViewItemEditedEventHandler PreviewEdited
Event Type
RadTreeViewItemEditedEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewEdited="RadTreeView1_PreviewEdited"/>
void private void RadTreeView1_PreviewEdited(object sender, RadTreeViewItemEditedEventArgs e)
{
// get a reference to the item that is being edited
RadTreeViewItem editedItem = e.Source as RadTreeViewItem;
string newText = e.NewText;
string oldText = e.OldText;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewEditStarted
Raised just before editing of an item has started. This is a wrapper for the EditableHeaderedItemsControl.PreviewEditStarted routed event.
Declaration
public event RadTreeViewItemEditedEventHandler PreviewEditStarted
Event Type
RadTreeViewItemEditedEventHandler
|
PreviewExpanded
Occurs before a child TreeView item is expanded.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewExpanded
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewExpanded="RadTreeView1_PreviewExpanded"/>
void private void RadTreeView1_PreviewExpanded(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be expanded
RadTreeViewItem itemToExpand = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewSelected
Occurs before a child tree view item is selected.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewSelected
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewSelected="RadTreeView1_PreviewSelected"/>
void private void RadTreeView1_PreviewSelected(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be selected
RadTreeViewItem itemToSelect = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewSelectionChanged
Raised just before the selected items collection has changed.
Declaration
public event SelectionChangedEventHandler PreviewSelectionChanged
Event Type
SelectionChangedEventHandler
|
PreviewUnchecked
Occurs before a child TreeView item is unchecked.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewUnchecked
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewUnchecked="RadTreeView1_PreviewUnchecked"/>
void private void RadTreeView1_PreviewUnchecked(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be unchecked
RadTreeViewItem itemToUncheck = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
PreviewUnselected
Occurs before a child tree view item is unselected.
Declaration
public event EventHandler<RadRoutedEventArgs> PreviewUnselected
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
PreviewUnselected="RadTreeView1_PreviewUnselected"/>
void private void RadTreeView1_PreviewUnselected(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that will be unselected
RadTreeViewItem itemToUnselect = e.Source as RadTreeViewItem;
// if the action should be canceled set Handled property to true
e.Handled = true;
}
Selected
Occurs when a child RadTreeView item has been selected.
Declaration
public event EventHandler<RadRoutedEventArgs> Selected
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Selected="RadTreeView1_Selected"/>
void RadTreeView1_Selected(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been selected
RadTreeViewItem newSelectedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
// get a reference to the selected data item of the TreeView
object selectedItem = treeView.SelectedItem;
// get a reference to the selected item container of the Treeview
RadTreeViewItem selectedItemContainer = treeView.SelectedContainer;
}
SelectionChanged
Occurs after the value of the SelectedItems property of a tree is changed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
SelectionChangedEventHandler
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
SelectionChanged="RadTreeView1_SelectionChanged"/>
void RadTreeView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
{
// get a reference to the item that has been selected
RadTreeViewItem newSelectedItem = e.Source as RadTreeViewItem;
// get the list of the added items to selection
IList addedItems = e.AddedItems;
// get the list of the removed items from the selection
IList removedItems = e.RemovedItems;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
Unchecked
Occurs when a child TreeView item has been unchecked.
Declaration
public event EventHandler<RadRoutedEventArgs> Unchecked
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Unchecked="RadTreeView1_Unchecked"/>
void RadTreeView1_Unchecked(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been unchecked
RadTreeViewItem uncheckedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
Unselected
Occurs when a child tree view item has been unselected.
Declaration
public event EventHandler<RadRoutedEventArgs> Unselected
Event Type
System.EventHandler<RadRoutedEventArgs>
|
Examples
Following code fragment shows the basic usage.
<telerik:RadTreeView
x:Name="RadTreeView1"
Unselected="RadTreeView1_Unselected"/>
void RadTreeView1_Unselected(object sender, RadRoutedEventArgs e)
{
// get a reference to the item that has been unselected
RadTreeViewItem unselectedItem = e.Source as RadTreeViewItem;
// get a reference to the RadTreeView
RadTreeView treeView = (sender as RadTreeView);
}
Explicit Interface Implementations
IScrollingInfo.ExtentHeight
Gets the height of the extent.
Declaration
double IScrollingInfo.ExtentHeight { get; }
Returns
System.Double
The height of the extent. |
Implements
IScrollingInfo.ExtentWidth
Gets the width of the extent.
Declaration
double IScrollingInfo.ExtentWidth { get; }
Returns
System.Double
The width of the extent. |
Implements
IScrollingInfo.HorizontalOffset
Gets the horizontal offset.
Declaration
double IScrollingInfo.HorizontalOffset { get; }
Returns
System.Double
The horizontal offset. |
Implements
IScrollingInfo.TransformFromDropTargetToViewPort(Point)
Calculate the mouse position relative to the drop element.
Declaration
Point IScrollingInfo.TransformFromDropTargetToViewPort(Point positionInDropTarget)
Parameters
System.Windows.Point
positionInDropTarget
DragDrop related data. |
Returns
System.Windows.Point
Relative DragPoint. |
Implements
IScrollingInfo.VerticalOffset
Gets the vertical offset.
Declaration
double IScrollingInfo.VerticalOffset { get; }
Returns
System.Double
The vertical offset. |
Implements
IScrollingInfo.ViewportHeight
Gets the height of the viewport.
Declaration
double IScrollingInfo.ViewportHeight { get; }
Returns
System.Double
The height of the viewport. |
Implements
IScrollingInfo.ViewportWidth
Gets the width of the viewport.
Declaration
double IScrollingInfo.ViewportWidth { get; }
Returns
System.Double
The width of the viewport. |
Implements
IScrollingServiceCore.ScrollHorizontal(Double)
Scrolls the horizontal to the given offset.
Declaration
void IScrollingServiceCore.ScrollHorizontal(double offsetX)
Parameters
System.Double
offsetX
The offset X. |
Implements
IScrollingServiceCore.ScrollVertical(Double)
Scrolls the vertical to the given offset.
Declaration
void IScrollingServiceCore.ScrollVertical(double offsetY)
Parameters
System.Double
offsetY
The offset Y. |