TreeNodeElement
Renders a single RadTreeNode as a row within the tree, composing the expander, image, toggle (check box) and content sub-elements.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TreeNodeElement : StackLayoutElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IVirtualizedElement<RadTreeNode>
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementStackLayoutElementTreeNodeElement...
Derived Classes:
Implements:
Inherited Members
Constructors
public TreeNodeElement()
Fields
Bit-vector key indicating that alternating-row formatting has been applied to this element.
protected const long AlrternatingColorSetState = 1
Identifies the dependency property that controls whether selection highlighting spans the full row width instead of only the label.
public static RadProperty FullRowSelectProperty
Bit-vector key storing the full-row selection setting copied from the tree view.
protected const long FullRowSelectState = 2
Identifies the dependency property that indicates whether an expander should be shown because the node has child nodes.
public static RadProperty HasChildrenProperty
Identifies the dependency property that controls whether the node highlights when the mouse hovers over it.
public static RadProperty HotTrackingProperty
Identifies the dependency property that reflects whether the owning tree view control currently lacks input focus.
public static RadProperty IsControlInactiveProperty
Identifies the dependency property that controls whether the node has keyboard focus within the tree.
public static RadProperty IsCurrentProperty
Identifies the dependency property that controls whether the node's children are visible.
public static RadProperty IsExpandedProperty
Identifies the dependency property that indicates whether the node has no parent node.
public static RadProperty IsRootNodeProperty
Identifies the dependency property that controls whether the node is rendered as selected.
public static RadProperty IsSelectedProperty
Identifies the dependency property that specifies a fixed row height for the node, or -1 to size automatically.
public static RadProperty ItemHeightProperty
Bit-vector key indicating that a check-state change originated from keyboard input.
protected const long UpdateCheckStateByKeyboard = 16
Bit-vector key indicating that a check-state change originated from mouse input.
protected const long UpdateCheckStateByMouse = 8
Bit-vector key indicating that measuring the row may require a scroll-range update.
protected const long UpdateScrollRangeIfNeeded = 4
Properties
Gets or sets whether the current check-state change is being processed as keyboard input. The tree view uses this flag to report the action source in check-state events.
protected bool CheckedByKeyboard { get; set; }
Gets or sets whether the current check-state change is being processed as mouse input. The tree view uses this flag to report the action source in check-state events.
protected bool CheckedByMouse { get; set; }
Gets the element that renders the node's text.
public TreeNodeContentElement ContentElement { get; }
Gets the data node this visual element currently represents.
public RadTreeNode Data { get; }
Implements:
Gets the input editor currently associated with this row, or null when the row is not being edited.
public IInputEditor Editor { get; }
Gets the element used to expand or collapse the node's children.
public TreeNodeExpanderItem ExpanderElement { get; }
Gets a value indicating whether this node contains child nodes.
public virtual bool HasChildren { get; }
Gets a value indicating that this is the hot tracking node.
public virtual bool HotTracking { get; }
Gets the element that renders the node's icon.
public TreeNodeImageElement ImageElement { get; }
Gets or sets a value indicating whether the control contains the focus.
public virtual bool IsControlFocused { get; }
Gets or sets a value indicating that this is the current node.
public virtual bool IsCurrent { get; }
Gets or sets a value indicating whether the node is expanded.
public virtual bool IsExpanded { get; }
Gets whether an input editor is currently associated with this row.
public bool IsInEditMode { get; }
Gets a value indicating whether the node is currently at root level.
public virtual bool IsRootNode { get; }
Gets or sets a value indicating whether the node is selected.
public virtual bool IsSelected { get; }
Gets or sets the arbitrary height for this particular node. Valid when the owning RadTreeViewElement's AllowArbitraryHeight property is set to true.
public virtual int ItemHeight { get; set; }
Gets the element that draws the connecting lines between this node and its parent/siblings.
public TreeNodeLinesContainer LinesContainerElement { get; }
Gets the check box or radio button element shown when the node is checkable, or null otherwise.
public RadToggleButtonElement ToggleElement { get; }
Gets or sets the displayed tooltip. When the base tooltip is empty, the node's tooltip is used; the tree view can suppress it. Setting this property changes the visual's tooltip and does not update the node's ToolTipText.
public override string ToolTipText { get; set; }
Overrides:
Gets the tree view element that owns this node.
public RadTreeViewElement TreeViewElement { get; }
Methods
Associates an editor with this row and adds its visual element to the node content when needed.
public virtual void AddEditor(IInputEditor editor)
The editor to associate with the row.
Applies the node's TreeNodeStyle appearance to the row or its content; full-row selection determines where fill, border, and gradient settings are applied.
protected virtual void ApplyStyle()
Associates this reusable visual element with the specified data node, refreshing its state to reflect the new data (used by virtualization).
public virtual void Attach(RadTreeNode data, object context)
Implements:
Creates the expander, connector, image, and content children and binds their visual-state properties to this row.
protected override void CreateChildElements()
Overrides:
Creates the element responsible for rendering the node's text and image content.
Creates the check box or radio button element appropriate for the node's CheckType, or null if the node is not checkable.
Releases the association with the currently attached data node so the element can be recycled for another node.
public virtual void Detach()
Implements:
Detaches the node and its property-change handler before releasing managed resources.
protected override void DisposeManagedResources()
Overrides:
Unsubscribes from and disposes the current check-box or radio-button child, if present.
protected virtual void DisposeToggleElement()
Combines the node image and content drag hints when both are available.
protected override Image GetDragHintCore()
The combined image hint, or the available image or content hint.
Overrides:
Configures the row for horizontal layout, drag-and-drop, and right-to-left-aware child placement.
protected override void InitializeFields()
Overrides:
Determines whether this element can be reused to represent the specified data node without recreating it (used by virtualization).
public virtual bool IsCompatible(RadTreeNode data, object context)
Implements:
Measures the row content, applies the configured item-height behavior, and updates node size and scroll range when required.
When attached to a tree view, raises its node click event, including mouse details when the event data is a MouseEventArgs.
protected override void OnClick(EventArgs e)
The click event data.
Overrides:
When attached to a tree view, raises its node double-click event, including mouse details when the event data is a MouseEventArgs.
protected override void OnDoubleClick(EventArgs e)
The double-click event data.
Overrides:
Applies alternating-row color when enabled and raises the tree view's node-formatting event.
protected virtual void OnFormatting()
When attached to a tree view, raises its node mouse-down event for the node represented by this row.
protected override void OnMouseDown(MouseEventArgs e)
The mouse-button and location details.
Overrides:
When attached to a tree view, raises its node mouse-enter event for the node represented by this row.
When attached to a tree view, raises its node mouse-hover event for the node represented by this row.
When attached to a tree view, raises its node mouse-leave event for the node represented by this row.
When attached to a tree view, raises its node mouse-move event for the node represented by this row.
protected override void OnMouseMove(MouseEventArgs e)
The mouse-button and location details.
Overrides:
When attached to a tree view, raises its node mouse-up event for the node represented by this row.
protected override void OnMouseUp(MouseEventArgs e)
The mouse-button and location details.
Overrides:
Updates the displayed row when its attached node changes selection, current state, text, expansion, check state, or style.
protected virtual void OnNodePropertyChanged(PropertyChangedEventArgs e)
The changed node property.
Refreshes formatting when hover, current-node, or style-driven color-count state changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The changed visual property and its new value.
Overrides:
Removes the specified editor when it is the editor currently associated with this row, then synchronizes the row.
public virtual void RemoveEditor(IInputEditor editor)
The editor to remove.
Refreshes the element's child sub-elements (image, toggle, content) to match the attached node's current state.
public virtual void Synchronize()
Implements:
Creates, replaces, or removes the check control to match the node's CheckType and CheckState.
protected virtual void SynchronizeToggleElement()