Class TreeViewAdv
The TreeViewAdv control is an advanced tree control that surpasses the functionality and look of the standard TreeView control. It displays a hierarchical collection of labeled items, each represented by a TreeNodeAdv.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class TreeViewAdv : ScrollControl, IDisposable, ICancelModeProvider, ISplitterPaneSupport, IScrollBarWrapperContainer, ISupportUpdating, ISupportIntelliMouse, IQueryFocusInside, ISupportInitialize, IThemedControl, INonClientPaintingSupport, IProvideCustomContextMenuPositionalInformation, IDragDispatcher, ISuppportHistory, IThemeProvider, IVisualStyle
Constructors
TreeViewAdv()
Initialize a new instance of the TreeViewAdv class.
Declaration
public TreeViewAdv()
Properties
ActiveNode
Gets or sets the active TreeNodeAdv.
Declaration
public TreeNodeAdv ActiveNode { get; set; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | The default value is Null. |
AddSeparatorAtEnd
Gets or sets the value indicates whether the GetPath(String) method adds a separator at the end of the path string returned.
Declaration
public virtual bool AddSeparatorAtEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
AllowIncreaseSmallChange
Gets or sets the value indicates whether the scroll control can increase the System.Windows.Forms.ScrollBar.SmallChange.
Declaration
public override bool AllowIncreaseSmallChange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Overrides
AllowKeyboardSearch
Gets or sets a value indicates whether keyboard based searching should be allowed.
Declaration
public virtual bool AllowKeyboardSearch { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is true. |
Remarks
When set to true, the users can key in char keys to browse to the next node that begins with that character(s). Multiple characters entered in succession will be assumed to be part of the same word, so search will be performed on that substring. Search will be restricted to IsVisible and Expanded nodes.
AllowMouseBasedSelection
Gets or sets the value indicates whether multiple nodes can be selected with mouse down and drag.
Declaration
public virtual bool AllowMouseBasedSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
BackColor
Gets or sets the background color for the TreeViewAdv.
Declaration
public override Color BackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BackgroundColor
Gets or sets the background color, gradient and other styles. This will override the BackColor setting.
Declaration
public BrushInfo BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
BrushInfo | BackgroundColor. |
Remarks
The TreeViewAdv provides this property to enable specialized custom gradient backgrounds.
BaseStylePairs
Gets or sets the base style name pairs.
Declaration
public StyleNamePairsList BaseStylePairs { get; }
Property Value
Type |
---|
StyleNamePairsList |
BaseStyles
Gets a collection of base styles used in the tree.
Declaration
public virtual Hashtable BaseStyles { get; }
Property Value
Type | Description |
---|---|
System.Collections.Hashtable | A Hash table of style names versus styles. The style names are of type string and the styles are of type TreeNodeAdvStyleInfo. |
Remarks
This collection holds the standard style that specifies the global node settings for all the nodes (is named "Standard"), the node level styles for nodes at specific levels (should use the convention "NodeLevelX") and other custom base styles. Also when you specify a style named "DragNodeCueStyle" that style will be applied on the nodes before preparing the drag-cue bitmap during drag-and-drop, a feature that can be turned on using the ShowDragNodeCue property.
BeforeTouchSize
Gets or sets Control size before touch enabled.
Declaration
public Size BeforeTouchSize { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Size | The default control size before enabling the TouchMode. |
Border3DStyle
Gets or sets the style of the 3D border.
Declaration
public Border3DStyle Border3DStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Border3DStyle | One of the Border3DStyle values. Default is Border3DStyle.Sunken. |
BorderColor
Gets or sets the color of the 2D border.
Declaration
public Color BorderColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The default value is Color.Black. |
Remarks
The BorderColor property is applied to TreeViewAdv when BorderStyle is set as FixedSingle.
BorderSides
Gets or sets the border sides of the TreeViewAdv that will be drawn.
Declaration
public Border3DSide BorderSides { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Border3DSide | One of the System.Windows.Forms.Border3DSide values. Default is Border3DSide.All. |
BorderSingle
Gets or sets the 2D border style.
Declaration
public ButtonBorderStyle BorderSingle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ButtonBorderStyle | One of the System.Windows.Forms.ButtonBorderStyle values. Default is ButtonBorderStyle.Solid. |
Remarks
The BorderSingle property is applied to TreeViewAdv when BorderStyle is set as FixedSingle.
BorderStyle
Gets or sets the border style of the control.
Declaration
public BorderStyle BorderStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.BorderStyle | One of the BorderStyle values. Default is BorderStyle.Fixed3D. |
CanApplyTheme
Gets or sets a value indicating whether a SkinManager theme style has been applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
CanOverrideStyle
Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.
Declaration
public bool CanOverrideStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
Remarks
By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.
CanSelectDisabledNode
Gets or sets to make disabled node selection.
Declaration
public bool CanSelectDisabledNode { get; set; }
Property Value
Type |
---|
System.Boolean |
CheckedMember
Gets or sets a value indicating the field to populate the state of checkbox of TreeNodeAdv in TreeViewAdv.
Declaration
public string CheckedMember { get; set; }
Property Value
Type |
---|
System.String |
CheckedNodes
Gets the checked nodes of the TreeViewAdv.
Declaration
public CheckedNodesCollection CheckedNodes { get; }
Property Value
Type |
---|
CheckedNodesCollection |
ChildMember
Gets or sets a value indicating the child data field which behaves as a Child Node in TreeViewAdv.
Declaration
public string ChildMember { get; set; }
Property Value
Type |
---|
System.String |
ClientHeight
Gets the ClientHeight
Declaration
protected int ClientHeight { get; }
Property Value
Type |
---|
System.Int32 |
ClosedImgIndex
Gets or sets the StateImageList index value of the image that is displayed when a TreeNodeAdv is collapsed.
Declaration
public virtual int ClosedImgIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An index into the StateImageList. Default is 1. |
CollapsedNodes
Gets the collection of Nodes which are in Collapsed state.
Declaration
public TreeNodeAdvCollection CollapsedNodes { get; }
Property Value
Type |
---|
TreeNodeAdvCollection |
CreateParams
Overrides System.Windows.Forms.Control.CreateParams.
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.CreateParams | A System.Windows.Forms.CreateParams that contains the required creation parameters when the handle to the control is created. |
Overrides
DataMember
Gets or sets a name of a specific data table within the DataSource.
Declaration
public string DataMember { get; set; }
Property Value
Type |
---|
System.String |
DataRelations
Contains the collection of DataRelation in TreeViewAdv
Declaration
public BindingList<DataRelation> DataRelations { get; }
Property Value
Type |
---|
System.ComponentModel.BindingList<DataRelation> |
DataSource
Gets or sets the Data Source object in TreeViewAdv
Declaration
public object DataSource { get; set; }
Property Value
Type |
---|
System.Object |
DefaultCollapseImageIndex
Gets or sets index of default image for collapse button.
Declaration
public int DefaultCollapseImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
DefaultExpandImageIndex
Gets or sets the index of default image for expand button.
Declaration
public int DefaultExpandImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
DelayToolTip
Gets or sets the value of delays Tool tip by one second.
Declaration
public bool DelayToolTip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
DisplayMember
Gets or sets the field that populates the Text property of the TreeNodeAdv in TreeViewAdv.
Declaration
public string DisplayMember { get; set; }
Property Value
Type |
---|
System.String |
DragOnText
Gets or sets the value indicates whether the drag-drop operation will occur only if the node is dragged on the text area.
Declaration
public virtual bool DragOnText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
EnableTouchMode
Gets or sets value to enable or disable the Touch mode to the controls.
Declaration
public override bool EnableTouchMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
Overrides
Remarks
Scale factor will be updated automatically if scale factor is equal to 1
EnableValidatingOnLabelEdit
Gets or sets the value indicates whether TreeNodeAdv text can be validated.
Declaration
public bool EnableValidatingOnLabelEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The Default value is false. |
EnableVirtualization
Gets or sets the value to indicate whether virtualization support is enabled for TreeViewAdv.
Declaration
[Obsolete("This property is obsolete. By default, TreeViewAdv will draw the nodes in a Virtualization manner")]
public bool EnableVirtualization { get; set; }
Property Value
Type |
---|
System.Boolean |
EnsureVisibleSelectedNode
Gets or sets the value indicates whether the selected node will be brought to view by scrolling, if necessary.
Declaration
public virtual bool EnsureVisibleSelectedNode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default is true. |
ExpandedNodes
Gets the collection of Nodes which are in Expanded state.
Declaration
public TreeNodeAdvCollection ExpandedNodes { get; }
Property Value
Type |
---|
TreeNodeAdvCollection |
ExpanderType
Represents ExpanderType either arrow or plus-minus in office 2016 and metro styles.
Declaration
public ExpanderType ExpanderType { get; set; }
Property Value
Type |
---|
ExpanderType |
FullRowSelect
Gets or sets the value indicates whether the complete row will be highlighted when a node is selected.
Declaration
public virtual bool FullRowSelect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
GridOfficeScrollBars
Gets or sets the OfficeScrollBars.
Declaration
public override OfficeScrollBars GridOfficeScrollBars { get; set; }
Property Value
Type |
---|
OfficeScrollBars |
Overrides
GutterSpace
Gets or sets the space left on the left side of the control.
Declaration
public virtual int GutterSpace { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Default is 3. |
HelpTextControl
Gets the help text control of the TreeViewAdv.
Declaration
public virtual ToolTipAdv HelpTextControl { get; }
Property Value
Type |
---|
ToolTipAdv |
Remarks
This is the control used to display the HelpText of the nodes.
HideSelection
Gets or sets the value indicates whether the TreeViewAdv will hide it's selected nodes when not focused.
Declaration
public virtual bool HideSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the selected tree node is not highlighted when the tree view has lost the focus; otherwise, false. |
HistoryEnabled
Gets or sets the value indicates whether register items in history list.
Declaration
public bool HistoryEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
HistoryManager
Gets or sets the HistoryManager to use.
Declaration
public HistoryManager HistoryManager { get; set; }
Property Value
Type |
---|
HistoryManager |
HorizontalScroll
Enables or disables horizontal scrollbar. This property will be set/reset by the tree as and when required.
Declaration
protected bool HorizontalScroll { get; set; }
Property Value
Type |
---|
System.Boolean |
HorizontalThumbTrack
Gets or sets the value indicates whether the control should scroll while the user is dragging a horizontal scrollbar thumb.
Declaration
public override bool HorizontalThumbTrack { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
Overrides
HotTracking
Gets or sets the value indicates whether the nodes will have a hot tracked appearance when the mouse cursor is hovering over them.
Declaration
public virtual bool HotTracking { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
HScroll
Gets or sets the values of horizontal scrollbar is enables or disables.
Declaration
public bool HScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
HScrollPos
Gets or sets the position of the Horizontal scrollbar.
Declaration
public int HScrollPos { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 1. |
IgnoreThemeBackground
Gets or sets the value indicates whether the control will ignore the theme's background color and draw the BackgroundColor instead when ThemesEnabled property is set as true.
Declaration
public bool IgnoreThemeBackground { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to ignore theme background; false otherwise. Default is false. |
InactiveSelectedNodeBackground
Gets or sets the background of the selected node when the control is not focused.
Declaration
public virtual BrushInfo InactiveSelectedNodeBackground { get; set; }
Property Value
Type | Description |
---|---|
BrushInfo | The default value is SystemColors.Control. |
InactiveSelectedNodeForeColor
Gets or sets the text color of the selected node when not focused.
Declaration
public virtual Color InactiveSelectedNodeForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The default value is a SystemColors.ControlText. |
Indent
Gets or sets the indent of the child nodes from the parent node.
Declaration
public virtual int Indent { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 19. |
InteractiveCheckBoxes
Gets or sets a value indicates whether the state of the parent nodes check box is based on the check state of it's child nodes check boxes.
Declaration
public virtual bool InteractiveCheckBoxes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
Remarks
If all child nodes are checked the parent node is also checked. The same with unchecked. If some child nodes are checked and some are unchecked then the parent node will have an indeterminate state. If the CheckState of the parent node is set by code or by clicking on it the state of all sub nodes will be set to that state.
IntermediateState
Gets or sets the value which indicates the Intermediate State to be in Tick or Box Style.
Declaration
public IntermediateState IntermediateState { get; set; }
Property Value
Type | Description |
---|---|
IntermediateState | The default value is Box. |
IsEditing
Gets a value indicates whether the selected node is in editing mode.
Declaration
public bool IsEditing { get; }
Property Value
Type |
---|
System.Boolean |
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the control. This also indicates whether the theme files are referred from external assemblies or not.
Declaration
public bool IsVisualStyleEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Return true, if the visual style based theme is applied to control. Otherwise returns false. |
ItemHeight
Gets or sets the default height of the nodes.
Declaration
public virtual int ItemHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is dependent on the control's font height. |
KeepDottedSelection
Gets or sets the value indicates whether control must draw dotted rectangle around selected node when it has no focus.
Declaration
public bool KeepDottedSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
KeepDragCapturePoint
Gets or sets the value indicates whether cue image should be drawn at a distance below the mouse cursor while dragging.
Declaration
public bool KeepDragCapturePoint { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
LabelEdit
Gets or sets the value indicates whether the label text of the tree nodes can be edited.
Declaration
public virtual bool LabelEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the label text of the tree nodes can be edited; false otherwise. |
Remarks
The BeginEdit(TreeNodeAdv) method will let you begin editing a node programmatically irrespective of this setting.
LastVisibleNode
Gets the last visible node.
Declaration
public virtual TreeNodeAdv LastVisibleNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv instance. |
Remarks
LeftImageList
Gets or sets the image list that holds images to be drawn on the left of the node.
Declaration
public virtual ImageList LeftImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | The ImageList that contains the System.Drawing.Image objects used by the tree nodes. |
Remarks
The LeftImageIndices will then indicate which images are to be drawn in the node.
LineColor
Gets or sets the color of the tree lines.
Declaration
public virtual Color LineColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | Default is Color.Gray. |
LineStyle
Gets or sets the line style of the tree lines.
Declaration
public virtual DashStyle LineStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Drawing2D.DashStyle | Default value is DashStyle.Dot. |
LoadOnDemand
Gets or sets the value indicates whether the tree should follow the load-on-demand paradigm.
Declaration
public virtual bool LoadOnDemand { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Remarks
When set to true, all the nodes will have the plus-minus set to visible to begin with. You should then handle the BeforeExpand event of the nodes and add sub nodes to the respective nodes. The tree will then keep or hide the plus-minus based on whether or not children were added.
This provides you a way to delay loading nodes in trees until the user initiates a node expand.
MetroArrowColorTable
Gets or sets the MetroColorTable to customize appearance of the collapse or expand button.
Declaration
public MetroArrowColorTable MetroArrowColorTable { get; set; }
Property Value
Type |
---|
MetroArrowColorTable |
MetroColor
Gets or sets the Metro color.
Declaration
public Color MetroColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
NoChildrenImgIndex
Gets or sets the StateImageList index value of the image that is displayed when a TreeNodeAdv has no children.
Declaration
public virtual int NoChildrenImgIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An index into the StateImageList. The default value is zero. |
Nodes
Gets or sets the top-level nodes collection of the TreeViewAdv.
Declaration
public virtual TreeNodeAdvCollection Nodes { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdvCollection | A TreeNodeAdvCollectionthat represents the tree nodes assigned to the tree view control. |
NodeStateImageList
Gets or sets ImageList with images that are displayed instead of expand or collapse button.
Declaration
public ImageList NodeStateImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | The ImageList that contains the System.Drawing.Image objects used by the tree nodes. |
Office2007ColorScheme
Gets or sets office 2007 color scheme.
Declaration
public Office2007Theme Office2007ColorScheme { get; set; }
Property Value
Type | Description |
---|---|
Office2007Theme | The default value is Office2007Theme.Blue |
Office2007ColorTable
Gets color table for Office2007 visual style.
Declaration
public Office2007Colors Office2007ColorTable { get; }
Property Value
Type |
---|
Office2007Colors |
Office2010ColorScheme
Gets or sets office 2010 color scheme.
Declaration
public Office2010Theme Office2010ColorScheme { get; set; }
Property Value
Type |
---|
Office2010Theme |
Office2010ColorTable
Gets color table for Office2010 visual style.
Declaration
public Office2010Colors Office2010ColorTable { get; }
Property Value
Type |
---|
Office2010Colors |
OpenImgIndex
Gets or sets the StateImageList index value of the image that is displayed when a TreeNodeAdv is expanded.
Declaration
public virtual int OpenImgIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An index into the StateImageList. Default is 2. |
OwnerDrawNodes
Gets or sets the value indicates whether the BeforeNodePaint and AfterNodePaint events will be fired before drawing a node.
Declaration
public virtual bool OwnerDrawNodes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
OwnerDrawNodesBackground
Gets or sets the value indicates whether the NodeBackgroundPaint event will be fired before drawing a node's background.
Declaration
public virtual bool OwnerDrawNodesBackground { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Padding
Gets or sets padding within the control.
Declaration
public Padding Padding { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Padding | A System.Windows.Forms.Padding indicating the space between the control edges and its contents. |
ParentMember
Gets or sets a value indicating the parent data field which behaves as a Parent Node in TreeViewAdv.
Declaration
public string ParentMember { get; set; }
Property Value
Type |
---|
System.String |
PathSeparator
Gets or sets the separator string that splits the path of a node and Call GetPath(String) to get the path of the specified node.
Declaration
public virtual string PathSeparator { get; set; }
Property Value
Type | Description |
---|---|
System.String | The delimiter string that the tree node System.Windows.Forms.TreeNode.FullPath property uses. |
PrintDocument
Gets or sets the PrintDocument.
Declaration
public TreeViewPrintDocument PrintDocument { get; set; }
Property Value
Type |
---|
TreeViewPrintDocument |
Printing
Gets a value indicates whether the TreeViewAdv is printing.
Declaration
public bool Printing { get; }
Property Value
Type |
---|
System.Boolean |
RecalculateExpansion
Gets or sets a value indicates if node dimension calculation should be done on load.
Declaration
public bool RecalculateExpansion { get; set; }
Property Value
Type |
---|
System.Boolean |
RightImageList
Gets or sets the image list that holds images to be drawn on the right of the node.
Declaration
public virtual ImageList RightImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | The ImageList that contains the System.Drawing.Image objects used by the tree nodes. |
Remarks
The RightImageIndices will then indicate which images are to be drawn in the node.
RMouseDownNode
Gets or sets the node on which the user did a right-mouse down.
Declaration
public virtual TreeNodeAdv RMouseDownNode { get; set; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv instance. |
Remarks
This property will return a non-null value only when the user has his mouse down or when the context menu is being shown for the tree.
Use this property in your context-menu's pop up event to determine on which node the user had right-clicked. However, do not use this property in a context menu item's Click property as this would be set to null by then. If the user right-clicked in the empty region then this property will return null.
When the user instead used the keyboard to invoke the context menu (via Shift+F10) then this property will return the currently selected node and the menu will also appear beside the selected node.
Root
Gets or sets the root node of the TreeViewAdv.
Declaration
public virtual TreeNodeAdv Root { get; set; }
Property Value
Type |
---|
TreeNodeAdv |
ScaleFactor
Gets or sets a value to scale the control based upon.
Declaration
public float ScaleFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The default value is 1. |
SelectedItem
Gets or sets the selected item in the TreeViewAdv.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The selected item in the TreeViewAdv, or null if no item is selected in the TreeViewAdv. |
Remarks
The SelectedItem property will return value only when DataSource is used to define the underlying tree data.
The SelectedItem property is set to an item when the IsSelected property value of the item in the TreeViewAdv is set to true.
If the
Examples
TreeViewAdv treeViewAdv1 = new TreeViewAdv();
treeViewAdv1.DisplayMember = "Place";
treeViewAdv1.ParentMember = "ParentID";
treeViewAdv1.ChildMember = "ChildID";
treeViewAdv1.DataSource = dataTable2;
//Sets the selected item form datatable
treeViewAdv1.SelectedItem = dataTable2.Rows[1];
The following example shows how to set the value of the SelectedItem property.
SelectedItems
Gets the SelectedItems objects from the DataSource in TreeViewAdv
Declaration
public BindingList<object> SelectedItems { get; set; }
Property Value
Type |
---|
System.ComponentModel.BindingList<System.Object> |
Remarks
SelectedItems will return value only when DataSource is used to define the underlying tree data
SelectedNode
Gets or sets the selected node of the TreeViewAdv.
Declaration
public virtual TreeNodeAdv SelectedNode { get; set; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | The TreeNodeAdv that is currently selected in the TreeViewAdv . |
Remarks
The tree fires the BeforeSelect event to let you cancel the change and AfterSelect event to notify you of a new selected node.
Use to SelectedNodes property when multi-node selection is turned on.
SelectedNode will not be set when DataSource is used to define the underlying tree data
SelectedNodeBackground
Gets or sets the background of the selected node.
Declaration
public virtual BrushInfo SelectedNodeBackground { get; set; }
Property Value
Type | Description |
---|---|
BrushInfo | The default value is SystemColors.Highlight. |
SelectedNodeForeColor
Gets or sets the text color of the selected TreeNodeAdv.
Declaration
public virtual Color SelectedNodeForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The default is a SystemColors.HighlightText. |
SelectedNodes
Gets the selected nodes of the TreeViewAdv.
Declaration
public SelectedNodesCollection SelectedNodes { get; }
Property Value
Type |
---|
SelectedNodesCollection |
Remarks
Use this property only when SelectionMode property lets you select multiple nodes. Otherwise, use SelectedNode to get the single selected node.
SelectedNodes will return null when DataSource is used to define the underlying tree data
SelectedValue
Gets the value to store the ValueMember value of the selected TreeNodeAdv in TreeViewAdv.
Declaration
public string SelectedValue { get; }
Property Value
Type |
---|
System.String |
SelectionBaseNode
Gets the base node and based on which multiple selection will be performed.
Declaration
public virtual TreeNodeAdv SelectionBaseNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv instance or null if there is no such node. |
Remarks
This node will be consulted while extending the selection in a multi-select scenario using user interaction or when calling the ExtendSelectionTo(TreeNodeAdv) method.
SelectionMode
Gets or sets the selection mode for the tree.
Declaration
public virtual TreeSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
TreeSelectionMode | The default value is TreeSelectionMode.Single. |
Remarks
Note that setting this property does not affect the current selection state.
For example, if the current selection includes multiple nodes and this property gets set
to TreeSelectionMode.Single, then the
SelectOnCollapse
Gets or sets a value indicating whether the collapsed node should be selected if any of the child node is selected or not.
Declaration
public bool SelectOnCollapse { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
If this property is set to false, it won't trigger the BeforeSelect and AfterSelect event after collapsing the node.
SelfRelationRootValue
Gets or sets the value that defines the root object in a self-relational mode when DataSource is used to define the underlying tree data.
Declaration
public string SelfRelationRootValue { get; set; }
Property Value
Type |
---|
System.String |
ShouldSelectNodeOnEnter
Gets or sets a value indicating whether the default node should be selected on the TreeViewAdv control gains focus.
Declaration
public bool ShouldSelectNodeOnEnter { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowCheckBoxes
Gets or sets the value indicates whether check boxes will be shown for the nodes.
Declaration
public virtual bool ShowCheckBoxes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
ShowDragNodeCue
Gets or sets the value indicates whether an alpha blended image of the selected nodes should be drawn beside the cursor during drag and drop.
Declaration
public virtual bool ShowDragNodeCue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to show an alpha blended image; false otherwise. Default is true. You could customize the style in which nodes are drawn in the above image by adding a "DragNodeCueStyle" style to the BaseStyles collection. |
ShowFocusRect
Gets or sets the FocusRect of the node.
Declaration
public bool ShowFocusRect { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowLines
Gets or sets the value indicates whether the tree lines are visible.
Declaration
public virtual bool ShowLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if lines are drawn between tree nodes in the tree view control; otherwise, false. |
ShowOptionButtons
Gets or sets a value indicates whether the nodes will have an option button.
Declaration
public virtual bool ShowOptionButtons { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
ShowPlusMinus
Gets or sets the value indicates whether the plus minus controls are visible.
Declaration
public virtual bool ShowPlusMinus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if plus sign and minus sign buttons are displayed next to tree nodes that contain child tree nodes; otherwise, false. |
ShowRootLines
Gets or sets the value indicates whether lines are drawn between the tree nodes that are at the root of the tree view.
Declaration
public virtual bool ShowRootLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if lines are drawn between the tree nodes that are at the root of the tree view; otherwise, false. |
ShowToolTip
Gets or sets the value indicates whether the Tool tip should be visible or not.
Declaration
public bool ShowToolTip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
SmartSizeBox
Gets or sets the value indicates whether the size box should be drawn when both scrollbars are visible and the control is not a docked window in an MDIChild window.
Declaration
public bool SmartSizeBox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
Remarks
Showing the size box works around a problem with .NET controls because by default the area at the bottom right is not drawn and that can cause drawing glitches. Note: Another better solution is drawing the NonClientArea ourselves. See SizeGripStyle which implements this newer solution.
SortWithChildNodes
Gets or sets a value indicating whether sort TreeViewAdv including all the child nodes.
Declaration
public bool SortWithChildNodes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
This example describes how to sort all the nodes in the TreeViewAdv
If SortWithChildNodes property is set to true,the user can sort all the nodes including all the child nodes in the treeViewAdv.
The SortOrder of the Root should be specified for the sorting all nodes.
//Sorts only the root nodes.
private void button1_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.Nodes.Sort();
}
//Sort all the root nodes and the child nodes in the TreeviewAdv
private void button2_Click_1(object sender, System.EventArgs e)
{
this.treeViewAdv1.Root.SortOrder=SortOrder.Ascending;
this.treeViewAdv1.SortWithChildNodes=true;
this.treeViewAdv1.Root.Sort();
}
'Sorts only the root nodes.
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Nodes.Sort()
End Sub
'Sort all the root nodes and the child nodes in the TreeviewAdv
Private Sub button2_Click_1(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Root.SortOrder=SortOrder.Ascending
Me.treeViewAdv1.SortWithChildNodes=True
Me.treeViewAdv1.Root.Sort()
End Sub
StandardStyle
Gets the standard style that all the nodes inherit from, by default.
Declaration
public TreeNodeAdvStyleInfo StandardStyle { get; }
Property Value
Type |
---|
TreeNodeAdvStyleInfo |
StateImageList
Gets or sets the image list that holds images to be drawn based on the state of the node.
Declaration
public virtual ImageList StateImageList { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageList | The ImageList that contains the System.Drawing.Image objects used by the tree nodes. |
Remarks
The OpenImgIndex, ClosedImgIndex and NoChildrenImgIndex properties refer to an image inside this list.
Style
Gets or sets the value indicates the visual style.
Declaration
public TreeStyle Style { get; set; }
Property Value
Type | Description |
---|---|
TreeStyle | The default value is true. |
SuspendExpandRecalculate
Gets or sets a value indicating whether the Recalculation of the Nodes maximum height should be done while expanding or collapsing.
Declaration
public bool SuspendExpandRecalculate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property can be reduced the delay while expanding/ collapsing the large number of nodes, if we set it as true.
ThemeName
Gets or sets the theme name of the ContextMenuStripEx control.
Declaration
public string ThemeName { get; set; }
Property Value
Type |
---|
System.String |
ThemesEnabled
Gets or sets the value indicates whether the control and it's parts should be drawn themed.
Declaration
public bool ThemesEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to enable themes; false otherwise. Default is false. |
ThemeStyle
Gets or sets the TreeViewAdvVisualStyle value used to customize the appearance of the TreeViewAdv.
Declaration
public TreeViewAdvVisualStyle ThemeStyle { get; set; }
Property Value
Type |
---|
TreeViewAdvVisualStyle |
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
ToolTipControl
Gets the tool tip control of the TreeViewAdv.
Declaration
public virtual ToolTipAdv ToolTipControl { get; }
Property Value
Type |
---|
ToolTipAdv |
Remarks
This is the control used to display the
TopVisibleNode
Gets the first fully-visible tree node in the tree view control.
Declaration
public TreeNodeAdv TopVisibleNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the first fully-visible tree node in the tree view control. |
Remarks
Initially, the TopVisibleNode returns the first root tree node, which is located at the top of the TreeViewAdv. However, if the user has scrolled the contents, another tree node might be at the top. TopVisibleNode
TransparentControls
Gets or sets the value indicates whether the controls (example, PlusMinus) will have a transparent background and slows down drawing of the TreeViewAdv control.
Declaration
public virtual bool TransparentControls { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default is false. |
ValueMember
Gets or sets the field that populates the Value property of TreeNodeAdv in TreeViewAdv.
Declaration
public string ValueMember { get; set; }
Property Value
Type |
---|
System.String |
VerticallScroll
Enables or disables vertical scrollbar. This property will be set/reset by the tree as and when required.
Declaration
protected bool VerticallScroll { get; set; }
Property Value
Type |
---|
System.Boolean |
VerticalThumbTrack
Gets or sets the value indicates whether the control should scroll while the user is dragging a vertical scrollbar thumb.
Declaration
public override bool VerticalThumbTrack { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
Overrides
VisibleCount
Gets the number of tree nodes that can be fully visible in the TreeViewAdv.
Declaration
public int VisibleCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of TreeNodeAdv items that can be fully visible in the TreeViewAdv control. |
Remarks
The VisibleCount value can be greater than the number of tree nodes in the tree view. The value is calculated by dividing the height of the client window by the height of a tree node item. The result is the total number of TreeNodeAdv objects that the TreeViewAdv is capable of displaying within its current dimensions.
VScroll
Gets or sets the values of vertical scrollbar is enables or disables.
Declaration
public bool VScroll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
VScrollIncrement
Gets or sets the multiplier for mouse wheel scrolling.
Declaration
public override int VScrollIncrement { get; set; }
Property Value
Type |
---|
System.Int32 |
Overrides
VScrollPixel
Gets or sets a value indicating whether it enables vertical pixel scrolling for the grid.
Declaration
public bool VScrollPixel { get; set; }
Property Value
Type |
---|
System.Boolean |
VScrollPos
Gets or sets the position of the Vertical scrollbar.
Declaration
public int VScrollPos { get; set; }
Property Value
Type |
---|
System.Int32 |
Methods
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | value to scale the factor based upon. |
BeginEdit()
Begins the editing of the selected node.
Declaration
public virtual void BeginEdit()
BeginEdit(TreeNodeAdv)
Overloaded. Begins the editing of the specified node.
Declaration
public void BeginEdit(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | The node to edit. |
CancelEditMode()
Cancels the edit mode of TreeViewAdv.
Declaration
public void CancelEditMode()
Remarks
The CancelEditMode method cancels the edit mode when the node is in the EditingMode.
CancelMode()
Cancels any current mouse based selection and edit mode.
Declaration
public void CancelMode()
CollapseAll()
Collapses all tree nodes of the TreeViewAdv.
Declaration
public void CollapseAll()
Remarks
The CollapseAll method collapses all the TreeNodeAdv objects, including all the child tree nodes, that are in the TreeViewAdv control.
The state of a TreeNodeAdv persists. For example, suppose that a parent tree node is expanded. If the child tree nodes were not previously collapsed, they will appear in their previously-expanded state. Calling the CollapseAll method ensures that all the tree nodes appear in the collapsed state.
CreateAccessibilityInstance()
Overrides the AccessibleObject.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type | Description |
---|---|
System.Windows.Forms.AccessibleObject | The TreeViewAdv that owns the TreeViewAdvAcessibleObject. |
CreateHelpText()
Creates the HelpText of the TreeViewAdv.
Declaration
public void CreateHelpText()
CreatetoolTip()
Creates a ToolTip of the TreeViewAdv.
Declaration
public void CreatetoolTip()
CustomControlPosition(Point)
Aligns the start of custom control in the same location.
Declaration
public void CustomControlPosition(Point Point)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | Point | Location of the Custom Control |
DispatchDoDragDrop(Object, DragDropEffects)
Dispatches the Drag drop operation.
Declaration
public DragDropEffects DispatchDoDragDrop(object data, DragDropEffects allowedEffects)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | |
System.Windows.Forms.DragDropEffects | allowedEffects |
Returns
Type |
---|
System.Windows.Forms.DragDropEffects |
DispatchDragOver(DragEventArgs)
Dispatches the drag over operation.
Declaration
public void DispatchDragOver(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
DispatchOnDragDrop(DragEventArgs)
Dispatches the drag drop operation.
Declaration
public void DispatchOnDragDrop(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
DispatchOnDragEnter(DragEventArgs)
Dispatches the drag enter operation.
Declaration
public void DispatchOnDragEnter(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
DispatchOnDragLeave(EventArgs)
Dispatches the DragLeave operation.
Declaration
public void DispatchOnDragLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs value that contains the event data. |
DispatchOnGiveFeedback(GiveFeedbackEventArgs)
Dispatches the GiveFeedback operation.
Declaration
public void DispatchOnGiveFeedback(GiveFeedbackEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.GiveFeedbackEventArgs | args |
DispatchOnQueryContinueDrag(QueryContinueDragEventArgs)
Dispatches the QueryContinueDrag operation.
Declaration
public void DispatchOnQueryContinueDrag(QueryContinueDragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.QueryContinueDragEventArgs | args |
Dispose(Boolean)
Cleans up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
DoDragDrop(Object, DragDropEffects)
Begins a drag-and-drop operation.
Declaration
public DragDropEffects DoDragDrop(object data, DragDropEffects allowedEffects)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data | The data to drag. |
System.Windows.Forms.DragDropEffects | allowedEffects | One of the DragDropEffects values. |
Returns
Type | Description |
---|---|
System.Windows.Forms.DragDropEffects | A value from the DragDropEffects enumeration that represents the final effect that was performed during the drag-and-drop operation. |
Draw(PaintEventArgs)
Implements the draw the whole control
Declaration
public void Draw(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e |
DrawBackground(PaintEventArgs)
Draws the Background of the TreeViewAdv
Declaration
protected virtual void DrawBackground(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | A System.Windows.Forms.PaintEventArgs value that contains the event data. |
EndEdit()
Forces the end of the editing of the selected node.
Declaration
public void EndEdit()
EndEdit(Boolean)
Saves or Cancels the editing of the selected node.
Declaration
public virtual void EndEdit(bool cancel)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | cancel | True to cancel editing; false to save changes. |
EnsureVisible(TreeNodeAdv)
Overloaded. Scrolls the control so that the specified node becomes visible.
Declaration
public void EnsureVisible(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | The node that requires visibility. |
EnsureVisibleH(TreeNodeAdv)
Scrolls the control so that the specified node becomes visible and optionally forces it to be the top-most visible node.
Declaration
public void EnsureVisibleH(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | The node that is to be scrolled |
EnsureVisibleV(TreeNodeAdv, Boolean)
Scrolls the control so that the specified node becomes visible and optionally forces it to be the top-most visible node.
Declaration
public void EnsureVisibleV(TreeNodeAdv node, bool showOnTop)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | The node that is to be scrolled. |
System.Boolean | showOnTop | True to force it to be the the top-most visible node; false to just scroll it into view. |
ExpandAll()
Expands all tree nodes of the TreeViewAdv.
Declaration
public void ExpandAll()
Remarks
The ExpandAll method expands all the TreeNodeAdv objects, including all the child tree nodes, that are in the TreeViewAdv control.
ExtendSelectionTo(TreeNodeAdv)
Overloaded. Extends the selection to the specified node.
Declaration
public void ExtendSelectionTo(TreeNodeAdv selNode)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | selNode | A TreeNodeAdv. |
Remarks
This method will not do anything if the SelectionMode property is set to TreeSelectionMode.Single.
ExtendSelectionTo(TreeNodeAdv, Boolean)
Extends the selection to the specified node.
Declaration
public void ExtendSelectionTo(TreeNodeAdv selNode, bool removeCurrentMultipleSelection)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | selNode | A TreeNodeAdv. |
System.Boolean | removeCurrentMultipleSelection | Indicates whether or not any current selection should be removed. |
Remarks
This method will not do anything if the SelectionMode property is set to TreeSelectionMode.Single.
GetActiveThemeName()
Gets the active theme name of the ContextMenuStripEx control.
Declaration
public string GetActiveThemeName()
Returns
Type | Description |
---|---|
System.String | Returns the active theme name. |
GetDraggedNodesBitmap()
Returns a System.Drawing.Bitmap that contains the image of the dragged nodes with it's state image.
Declaration
public Bitmap GetDraggedNodesBitmap()
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | A System.Drawing.Bitmap instance when there is atleast one selected node; Null otherwise. |
GetHeightOfRows(Int32, Int32)
Returns the total height of the rows from the specified start to end.
Declaration
public int GetHeightOfRows(int start, int end)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | The top row. |
System.Int32 | end | The bottom row. |
Returns
Type | Description |
---|---|
System.Int32 | The total height. |
GetNodeAtPoint(Point)
Returns the node at the specified location.
Declaration
public TreeNodeAdv GetNodeAtPoint(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | The System.Drawing.Point to evaluate and retrieve the node from. |
Returns
Type | Description |
---|---|
TreeNodeAdv | The TreeNodeAdv at the specified point, in TreeViewAdv (client) coordinates, or null if there is no node at that location. |
GetNodeAtPoint(Point, Boolean)
Returns the node at the specified location.
Declaration
public TreeNodeAdv GetNodeAtPoint(Point pt, bool textBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | Location. |
System.Boolean | textBounds | Indicates whether the testing will be done using the bounds of the text, not the whole bounds of the node. |
Returns
Type | Description |
---|---|
TreeNodeAdv | The node at the point. |
GetNodeAtPoint(Point, Boolean, Boolean)
Returns the node at the specified location.
Declaration
public TreeNodeAdv GetNodeAtPoint(Point pt, bool textBounds, bool textOrImageBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | Location. |
System.Boolean | textBounds | Indicates whether the testing will be done using the bounds of the text, not the whole bounds of the node. |
System.Boolean | textOrImageBounds | Indicates whether the testing will be done using the bounds of the images and text, not the whole bounds of the node. |
Returns
Type | Description |
---|---|
TreeNodeAdv | The node at the point. |
Remarks
If both the textBounds and textOrImageBounds params are false then the testing will be done on the whole node.
GetNodeAtPoint(Int32, Int32)
Overloaded. Returns the TreeNodeAdv at the point with the specified coordinates.
Declaration
public TreeNodeAdv GetNodeAtPoint(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The X - coordinate position to evaluate and retrieve the TreeNodeAdv from TreeViewAdv. |
System.Int32 | y | The Y - coordinate position to evaluate and retrieve the TreeNodeAdv from TreeViewAdv. |
Returns
Type | Description |
---|---|
TreeNodeAdv | The TreeNodeAdv at the specified location, in TreeViewAdv (client) coordinates, or null if there is no node at that location. |
GetNodeAtPointEx(Point)
Returns the node at the specified point.
Declaration
public TreeNodeAdv GetNodeAtPointEx(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | Specified point. |
Returns
Type | Description |
---|---|
TreeNodeAdv | Node at specified point if exist; null otherwise. |
GetNodeCount(Boolean)
Returns the number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.
Declaration
public int GetNodeCount(bool includeSubTrees)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeSubTrees | true to count the TreeNodeAdv items that the subtrees contain; false otherwise. |
Returns
Type | Description |
---|---|
System.Int32 | The number of tree nodes, optionally including those in all subtrees, assigned to the tree view control. |
Remarks
If includeSubTrees is true, the result is the number of all the tree nodes in the entire tree structure.
Examples
This example describes how to count all the nodes(including child nodes) of the treeViewAdv The user could get the total number of nodes by calling GetNodeCount method with the bool argument which indicates whether count should include sub trees or not. If we pass it as true, it will count the nodes with the subtrees also.
private void button1_Click(object sender, System.EventArgs e)
{
//Call the tree control's "GetNodeCount" method with true to
//get the total number of nodes in the tree
int TotalNodesInTree = this.treeViewAdv1.GetNodeCount( true );
MessageBox.Show( "Total nodes in tree = " + TotalNodesInTree.ToString());
}
//Add nodes
private void button2_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Nodes.Add(new TreeNodeAdv());
}
//Remove nodes
private void button3_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(this.treeViewAdv1.SelectedNode);
}
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' Call the tree control's "GetNodeCount" method with true to
' get the total number of nodes in the tree
Dim TotalNodesInTree As Integer = Me.treeViewAdv1.GetNodeCount(True)
MessageBox.Show("Total nodes in tree = " & TotalNodesInTree.ToString())
End Sub
'Add nodes
Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Nodes.Add(New TreeNodeAdv())
End Sub
'Remove nodes
Private Sub button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(Me.treeViewAdv1.SelectedNode)
End Sub
GetNodeFromPath(String)
Returns a node from the specified path. Make sure that the path does not end with a separator when calling this.
Declaration
public TreeNodeAdv GetNodeFromPath(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path of the node. |
Returns
Type | Description |
---|---|
TreeNodeAdv | The node that has the specified path. |
GetPathFromNode(TreeNodeAdv)
Returns the path of the specified node.
Declaration
public string GetPathFromNode(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | Node whose path is to be returned. |
Returns
Type | Description |
---|---|
System.String | The path of the node. |
GetSelectedNodesRectangle(TreeNodeAdv[])
Returns the smallest rectangle enclosing the selected region of all the nodes specified.
Declaration
protected Rectangle GetSelectedNodesRectangle(TreeNodeAdv[] tnas)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv[] | tnas | The nodes whose selected region is to be included in the resultant rect. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The bounding Rectangle. |
Remarks
The node's text and left images will be included in the rectangles.
IsInputChar(Char)
Declaration
protected override bool IsInputChar(char charCode)
Parameters
Type | Name | Description |
---|---|---|
System.Char | charCode |
Returns
Type |
---|
System.Boolean |
IsInputKey(Keys)
Declaration
protected override bool IsInputKey(Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
MeasureDisplayStringSize(Graphics, String, Font)
Returns the width required to draw the text specified using the font specified.
Declaration
public Size MeasureDisplayStringSize(Graphics graphics, string text, Font font)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | graphics | A System.Drawing.Graphics object. |
System.String | text | The text that is to be drawn. |
System.Drawing.Font | font | The System.Drawing.Font using which to draw. |
Returns
Type | Description |
---|---|
System.Drawing.Size | Width required. |
MirrorHorizontalPosition(Int32, Int32)
Declaration
protected int MirrorHorizontalPosition(int nX, int nWidth)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nX | |
System.Int32 | nWidth |
Returns
Type |
---|
System.Int32 |
NodeToPoint(TreeNodeAdv)
Returns the location of the tree node in client co-ordinates.
Declaration
public Point NodeToPoint(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | The TreeNodeAdv whose location you need. |
Returns
Type | Description |
---|---|
System.Drawing.Point | A System.Drawing.Point. |
NodeToRectangle(TreeNodeAdv)
Returns the rectangular area in which the tree node will be drawn.
Declaration
public Rectangle NodeToRectangle(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | A TreeNodeAdv. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | A System.Drawing.Rectangle. |
NodeToRowIndex(TreeNodeAdv)
Returns the row index of a tree node.
Declaration
public int NodeToRowIndex(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | A TreeNodeAdv. |
Returns
Type | Description |
---|---|
System.Int32 | The row index. |
OnAfterCheck(TreeNodeAdvEventArgs)
Raises the AfterCheck event.
Declaration
protected virtual void OnAfterCheck(TreeNodeAdvEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvEventArgs | e | A TreeNodeAdvEventArgs that contains the event data. |
Remarks
The OnAfterCheck method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterCheck in a derived class, be sure to call the base class's OnAfterCheck method so that registered delegates receive the event.
OnAfterCollapse(TreeViewAdvNodeEventArgs)
Raises the AfterCollapse event.
Declaration
protected virtual void OnAfterCollapse(TreeViewAdvNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeViewAdvNodeEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnAfterCollapse method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterCollapse in a derived class, be sure to call the base class's OnAfterCollapse method so that registered delegates receive the event.
OnAfterExpand(TreeViewAdvNodeEventArgs)
Raises the AfterExpand event.
Declaration
protected virtual void OnAfterExpand(TreeViewAdvNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeViewAdvNodeEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnAfterExpand method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterExpand in a derived class, be sure to call the base class's OnAfterExpand method so that registered delegates receive the event.
OnAfterInteractiveChecks(TreeNodeAdvEventArgs)
Raises the AfterInteractiveChecks event.
Declaration
protected virtual void OnAfterInteractiveChecks(TreeNodeAdvEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvEventArgs | e | A TreeNodeAdvEventArgs that contains the event data. |
Remarks
The OnAfterInteractiveChecks method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterInteractiveChecks in a derived class, be sure to call the base class's OnAfterInteractiveChecks method so that registered delegates receive the event.
OnAfterNodePaint(TreeNodeAdvPaintEventArgs)
Raises the AfterNodePaint event.
Declaration
protected virtual void OnAfterNodePaint(TreeNodeAdvPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvPaintEventArgs | e | An TreeNodeAdvPaintEventArgs that contains the event data. |
Remarks
The OnAfterNodePaint method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterNodePaint in a derived class, be sure to call the base class's OnAfterNodePaint method so that registered delegates receive the event.
OnAfterSelect(EventArgs)
Raises the AfterSelect event.
Declaration
protected virtual void OnAfterSelect(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnAfterSelect method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnAfterSelect in a derived class, be sure to call the base class's OnAfterSelect method so that registered delegates receive the event.
OnBeforeCheck(TreeNodeAdvBeforeCheckEventArgs)
Raises the BeforeCheck event.
Declaration
protected virtual void OnBeforeCheck(TreeNodeAdvBeforeCheckEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvBeforeCheckEventArgs | e | An |
Remarks
The OnBeforeCheck method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeCheck in a derived class, be sure to call the base class's OnBeforeCheck method so that registered delegates receive the event.
OnBeforeCollapse(TreeViewAdvCancelableNodeEventArgs)
Raises the BeforeCollapse event.
Declaration
protected virtual void OnBeforeCollapse(TreeViewAdvCancelableNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeViewAdvCancelableNodeEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnBeforeCollapse method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeCollapse in a derived class, be sure to call the base class's OnBeforeCollapse method so that registered delegates receive the event.
OnBeforeEdit(TreeNodeAdvBeforeEditEventArgs)
Raises the BeforeEdit event.
Declaration
protected virtual void OnBeforeEdit(TreeNodeAdvBeforeEditEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvBeforeEditEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnBeforeEdit method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeEdit in a derived class, be sure to call the base class's OnBeforeEdit method so that registered delegates receive the event.
OnBeforeExpand(TreeViewAdvCancelableNodeEventArgs)
Raises the BeforeExpand event.
Declaration
protected virtual void OnBeforeExpand(TreeViewAdvCancelableNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeViewAdvCancelableNodeEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnBeforeExpand method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeExpand in a derived class, be sure to call the base class's OnBeforeExpand method so that registered delegates receive the event.
OnBeforeNodePaint(TreeNodeAdvPaintEventArgs)
Raises the BeforeNodePaint event.
Declaration
protected virtual void OnBeforeNodePaint(TreeNodeAdvPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvPaintEventArgs | e | An TreeNodeAdvPaintEventArgs that contains the event data. |
Remarks
The OnBeforeNodePaint method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeNodePaint in a derived class, be sure to call the base class's OnBeforeNodePaint method so that registered delegates receive the event.
OnBeforeSelect(TreeViewAdvCancelableSelectionEventArgs)
Raises the BeforeSelect event.
Declaration
protected virtual void OnBeforeSelect(TreeViewAdvCancelableSelectionEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeViewAdvCancelableSelectionEventArgs | e | An TreeViewAdvCancelableSelectionEventArgs that contains the event data. |
Remarks
The OnBeforeSelect method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBeforeSelect in a derived class, be sure to call the base class's OnBeforeSelect method so that registered delegates receive the event.
OnBorder3DStyleChanged()
Raises the Border3DStyleChanged event.
Declaration
protected virtual void OnBorder3DStyleChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorder3DStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorder3DStyleChanged in a derived class, be sure to call the base class's OnBorder3DStyleChanged method so that registered delegates receive the event.
OnBorderColorChanged()
Raises the BorderColorChanged event.
Declaration
protected virtual void OnBorderColorChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderColorChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorderColorChanged in a derived class, be sure to call the base class's OnBorderColorChanged method so that registered delegates receive the event.
OnBorderSidesChanged()
Raises the BorderSidesChanged event.
Declaration
protected virtual void OnBorderSidesChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderSidesChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OmBorderSidesChanged in a derived class, be sure to call the base class's OnBorderSidesChanged method so that registered delegates receive the event.
OnBorderSingleChanged()
Raises the BorderSingleChanged event.
Declaration
protected virtual void OnBorderSingleChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBorderSingleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorderSingleChanged in a derived class, be sure to call the base class's OnBorderSingleChanged method so that registered delegates receive the event.
OnBorderStyleChanged()
Raises the BorderStyleChanged event.
Declaration
protected virtual void OnBorderStyleChanged()
Remarks
The OnBorderStyleChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnBorderStyleChanged in a derived class, be sure to call the base class's OnBorderStyleChanged method so that registered delegates receive the event.
OnDataSourceChanged(Object, Object)
Occurs when DataSource is changed
Declaration
protected virtual void OnDataSourceChanged(object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldValue | |
System.Object | newValue |
OnDefaultCollapseImageIndexChanged()
Raises the DefaultCollapseImageIndexChanged event.
Declaration
protected virtual void OnDefaultCollapseImageIndexChanged()
OnDefaultExpandImageIndexChanged()
Raises the DefaultExpandImageIndexChanged event.
Declaration
protected virtual void OnDefaultExpandImageIndexChanged()
OnDoubleClick(EventArgs)
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnDragDrop(DragEventArgs)
Performs the actions required on drag drop. (Overridden method)
Declaration
protected override void OnDragDrop(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnDragEnter(DragEventArgs)
Performs actions required while drag enter. (Overridden method)
Declaration
protected override void OnDragEnter(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | drgevent |
OnDragLeave(EventArgs)
Performs actions required while drag leaves. (Overridden method)
Declaration
protected override void OnDragLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | A System.EventArgs value that contains the event data. |
OnDragOver(DragEventArgs)
Performs the actions required while drag over. (Overridden method)
Declaration
protected override void OnDragOver(DragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.DragEventArgs | e |
Overrides
OnEditCancelled(TreeNodeAdvEditEventArgs)
Raises the edit cancel event.
Declaration
protected virtual void OnEditCancelled(TreeNodeAdvEditEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvEditEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnEditCancelled method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnEditCancelled in a derived class, be sure to call the base class's OnEditCancelled method so that registered delegates receive the event.
OnEnter(EventArgs)
Raises the OnEnter event.
Declaration
protected override void OnEnter(EventArgs arg)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | arg | A System.EventArgs value that contains the event data. |
Overrides
OnFontChanged(EventArgs)
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnForeColorChanged(EventArgs)
Declaration
protected override void OnForeColorChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnGiveFeedback(GiveFeedbackEventArgs)
Performs actions required OnGiveFeedback. (Overridden method)
Declaration
protected override void OnGiveFeedback(GiveFeedbackEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.GiveFeedbackEventArgs | args |
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnGradientBackgroundChanged()
Raises the GradientBackgroundChanged event.
Declaration
protected virtual void OnGradientBackgroundChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnGradientBackgroundChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnGradientBackgroundChanged in a derived class, be sure to call the base class's OnGradientBackgroundChanged method so that registered delegates receive the event.
OnGradientColorsChanged()
Raises the GradientColorsChanged event.
Declaration
protected virtual void OnGradientColorsChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnGradientColorsChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnGradientColorsChanged in a derived class, be sure to call the base class's OnGradientColorsChanged method so that registered delegates receive the event.
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnHScrollBarValueChanged(Object, EventArgs)
Declaration
protected override void OnHScrollBarValueChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
Overrides
OnInvalidated(InvalidateEventArgs)
Declaration
protected override void OnInvalidated(InvalidateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.InvalidateEventArgs | e |
Overrides
OnItemDrag(ItemDragEventArgs)
Raises the ItemDrag event.
Declaration
protected virtual void OnItemDrag(ItemDragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ItemDragEventArgs | e | An ItemDragEventArgs that contains the event data. |
Remarks
The OnItemDrag method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnItemDrag in a derived class, be sure to call the base class's OnItemDrag method so that registered delegates receive the event.
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | e |
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnMouseDown(MouseEventArgs)
Raises the OnMouseDown
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e | A System.Windows.Forms.MouseEventArgs value that contains the event data. |
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnMouseHover(EventArgs)
Performs actions required on mouse hover. (Overridden method)
Declaration
protected override void OnMouseHover(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Overrides
OnMouseWheel(MouseEventArgs)
Overriding the OnMouseWheel function to handle the mouse wheel processing for scroll bars.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
Overrides
OnNodeBackgroundPaint(TreeNodeAdvPaintBackgroundEventArgs)
Raises the NodeBackgroundPaint event.
Declaration
protected virtual void OnNodeBackgroundPaint(TreeNodeAdvPaintBackgroundEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvPaintBackgroundEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnNodeBackgroundPaint method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnNodeBackgroundPaint in a derived class, be sure to call the base class's OnNodeBackgroundPaint method so that registered delegates receive the event.
OnNodeEditorValidated(TreeNodeAdvEditEventArgs)
Raises the NodeEditorValidated event.
Declaration
protected virtual void OnNodeEditorValidated(TreeNodeAdvEditEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvEditEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnNodeEditorValidated method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnNodeEditorValidated in a derived class, be sure to call the base class's OnNodeEditorValidated method so that registered delegates receive the event.
OnNodeEditorValidateString(TreeNodeAdvCancelableEditEventArgs)
Raises the NodeEditorValidateString event.
Declaration
protected virtual void OnNodeEditorValidateString(TreeNodeAdvCancelableEditEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvCancelableEditEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnNodeEditorValidateString method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnNodeEditorValidateString in a derived class, be sure to call the base class's OnNodeEditorValidateString method so that registered delegates receive the event.
OnNodeEditorValidating(TreeNodeAdvCancelableEditEventArgs)
Raises the NodeEditorValidating event.
Declaration
protected virtual void OnNodeEditorValidating(TreeNodeAdvCancelableEditEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvCancelableEditEventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnNodeEditorValidating method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnNodeEditorValidating in a derived class, be sure to call the base class's OnNodeEditorValidating method so that registered delegates receive the event.
OnNodeStateImageListChanged()
Raises the NodeStateImageListChanged event.
Declaration
protected virtual void OnNodeStateImageListChanged()
OnPaint(PaintEventArgs)
Raises the OnPaint event.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e |
Overrides
OnPaintBackground(PaintEventArgs)
Declaration
protected override void OnPaintBackground(PaintEventArgs pevent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | pevent |
OnParentChanged(EventArgs)
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnQueryContinueDrag(QueryContinueDragEventArgs)
Performs actions required while QueryContinueDrag. (Overridden method)
Declaration
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.QueryContinueDragEventArgs | args |
OnRightToLeftChanged(EventArgs)
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnSelectionModeChanged()
Declaration
protected virtual void OnSelectionModeChanged()
OnSetCursor(ref Message)
Performs actions required on setting up the cursor. (Overridden method)
Declaration
protected override void OnSetCursor(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m |
Overrides
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnThemeChanged(EventArgs)
Raises the ThemeChanged event.
Declaration
protected virtual void OnThemeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnThemeChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnThemeChanged in a derived class, be sure to call the base class's OnThemeChanged method so that registered delegates receive the event.
OnUpdatingChanged(EventArgs)
Declaration
protected override void OnUpdatingChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
Overrides
OnVerticalGradientChanged()
Raises the VerticalGradientChanged event.
Declaration
protected virtual void OnVerticalGradientChanged()
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnVerticalGradientChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnVerticalGradientChanged in a derived class, be sure to call the base class's OnVerticalGradientChanged method so that registered delegates receive the event.
OnVerticalScroll(ScrollEventArgs)
Occurs when the Vertical scroll bar is scrolled.
Declaration
protected override void OnVerticalScroll(ScrollEventArgs se)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ScrollEventArgs | se | The System.Windows.Forms.ScrollEventArgs contains the event data. |
Overrides
OnVScrollBarValueChanged(Object, EventArgs)
Declaration
protected override void OnVScrollBarValueChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
Overrides
PointToNode(Point)
Returns the tree node at the specified point in client co-ordinates.
Declaration
public TreeNodeAdv PointToNode(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt | The point in client co-ordinates. |
Returns
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv. |
Print()
Begins the printing process of the TreeViewAdv.
Declaration
public void Print()
PrintPreview()
Begins the printing process of the TreeViewAdv and shows TreeViewAdv before printing.
Declaration
public void PrintPreview()
ProcessDialogKey(Keys)
Do this instead of listening to KeyDown in TextBox which prevents the gong sound when hitting esc key in text box. In a native applications. scenario this won't be hit, so we instead listen to the TextBox's KeyDown event and process the keys there.
Declaration
protected override bool ProcessDialogKey(Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
ProcessMouseBasedSelection(MouseEventArgs)
This method indicates that the multipleNodes can be selected with mouseDown and drag .
Declaration
protected virtual void ProcessMouseBasedSelection(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.MouseEventArgs | e |
RaiseItemDrag(ItemDragEventArgs)
Represents the OnItemDrag(ItemDragEventArgs) to raise the ItemDrag event.
Declaration
public void RaiseItemDrag(ItemDragEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ItemDragEventArgs | e | An ItemDragEventArgs that contains the event data. |
RaiseNodeDoubleClick(TreeNodeAdv, MouseButtons, Int32, Int32, Int32, Int32)
Declaration
protected void RaiseNodeDoubleClick(TreeNodeAdv hitnode, MouseButtons button, int clicks, int x, int y, int delta)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | hitnode | |
System.Windows.Forms.MouseButtons | button | |
System.Int32 | clicks | |
System.Int32 | x | |
System.Int32 | y | |
System.Int32 | delta |
RaiseNodeHotTracked()
Declaration
protected void RaiseNodeHotTracked()
RaiseNodeSingleClick(TreeNodeAdv, MouseButtons, Int32, Int32, Int32, Int32)
Declaration
protected void RaiseNodeSingleClick(TreeNodeAdv hitnode, MouseButtons button, int clicks, int x, int y, int delta)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | hitnode | |
System.Windows.Forms.MouseButtons | button | |
System.Int32 | clicks | |
System.Int32 | x | |
System.Int32 | y | |
System.Int32 | delta |
Refresh()
Overridden. Forces the control to invalidate its client area and immediately redraw itself and any child controls.
Declaration
public override void Refresh()
ResetBackColor()
Resets the BackColor property to it's default value.
Declaration
public override void ResetBackColor()
ResetBackgroundColor()
Resets the BackgroundColor property to it's default value.
Declaration
protected void ResetBackgroundColor()
ResetBorderColor()
Resets the BorderColor property to it's default value.
Declaration
protected void ResetBorderColor()
ResetClosedImgIndex()
Resets the ClosedImgIndex property to it's default value.
Declaration
public void ResetClosedImgIndex()
ResetEnableValidatingOnLabelEdit()
Resets the EnableValidatingOnLabelEdit property to it's default value.
Declaration
public void ResetEnableValidatingOnLabelEdit()
ResetExpanderType()
Declaration
protected void ResetExpanderType()
ResetHelpText()
Resets the
Declaration
public virtual void ResetHelpText()
ResetInactiveSelectedNodeBackground()
Resets the InactiveSelectedNodeBackground property to it's default value.
Declaration
protected void ResetInactiveSelectedNodeBackground()
ResetInactiveSelectedNodeForeColor()
Resets the InactiveSelectedNodeForeColor property to it's default value.
Declaration
protected void ResetInactiveSelectedNodeForeColor()
ResetInteractiveCheckBoxes()
Resets the InteractiveCheckBoxes property to it's default value.
Declaration
public void ResetInteractiveCheckBoxes()
ResetIsFromRibbon()
Declaration
protected void ResetIsFromRibbon()
ResetItemHeight()
Resets the ItemHeight property to it's default value.
Declaration
public void ResetItemHeight()
ResetLineColor()
Resets the LineColor property to it's default value.
Declaration
protected void ResetLineColor()
ResetNoChildrenImgIndex()
Resets the NoChildrenImgIndex property to it's default value.
Declaration
public void ResetNoChildrenImgIndex()
ResetOpenImgIndex()
Resets the OpenImgIndex property to it's default value.
Declaration
public void ResetOpenImgIndex()
ResetSelectedNodeBackground()
Resets the SelectedNodeBackground property to it's default value.
Declaration
protected void ResetSelectedNodeBackground()
ResetSelectedNodeForeColor()
Resets the SelectedNodeForeColor property to it's default value.
Declaration
protected void ResetSelectedNodeForeColor()
ResetShowCheckBoxes()
Resets the ShowCheckBoxes property to it's default value.
Declaration
public void ResetShowCheckBoxes()
ResetShowOptionButtons()
Resets the ShowOptionButtons property to it's default value.
Declaration
public void ResetShowOptionButtons()
ResetShowPlusMinus()
Resets the ShowPlusMinus property to it's default value.
Declaration
public void ResetShowPlusMinus()
ResetShowToolTip()
Resets the ShowToolTip property to it's default value.
Declaration
public void ResetShowToolTip()
ResetThemesEnabled()
Resets the ThemesEnabled property to it's default value.
Declaration
protected void ResetThemesEnabled()
ResetToolTip()
Resets the
Declaration
public virtual void ResetToolTip()
RowIndexToNode(Int32)
Returns the tree node at the specified row index.
Declaration
public TreeNodeAdv RowIndexToNode(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
Returns
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv. |
SetDefaultSelectionOnEnter()
Selects a default node (the first visible one) if the tree did not have anything focused.
Declaration
protected virtual void SetDefaultSelectionOnEnter()
SetSelectedNode(ArrayList, ArrayList, TreeViewAdvAction, Boolean, Boolean)
This method is used internally by the tree control to add and remove selected nodes. This method will fire the appropriate selection events to let the user cancel the selection, etc.
Declaration
protected bool SetSelectedNode(ArrayList nodesToAdd, ArrayList nodesToRemove, TreeViewAdvAction action, bool fireEvent, bool forceRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ArrayList | nodesToAdd | The nodes to add. |
System.Collections.ArrayList | nodesToRemove | The nodes to remove. |
TreeViewAdvAction | action | Specifies what kind of action triggered this call. |
System.Boolean | fireEvent | Indicates whether selection events should be fired before and after this selection change. |
System.Boolean | forceRemove | Indicates whether the specified nodes to be removed from selection will be removed even if the user cancelled the selection change the BeforeSelect event handler. |
Returns
Type | Description |
---|---|
System.Boolean | True if the selection changed; false otherwise. |
SetSelectionBaseNode(TreeNodeAdv)
Overrides
Declaration
protected void SetSelectionBaseNode(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node |
ShouldSerializeBackColor()
Indicates whether the current value of the BackColor property is to be serialized.
Declaration
protected bool ShouldSerializeBackColor()
Returns
Type | Description |
---|---|
System.Boolean | The BackColor value. |
ShouldSerializeBackgroundColor()
Indicates whether the current value of the BackgroundColor property is to be serialized.
Declaration
protected bool ShouldSerializeBackgroundColor()
Returns
Type | Description |
---|---|
System.Boolean | The BackgroundColor value. |
ShouldSerializeBorderColor()
Indicates whether the current value of the BorderColor property is to be serialized.
Declaration
protected bool ShouldSerializeBorderColor()
Returns
Type | Description |
---|---|
System.Boolean | The BackColor value. |
ShouldSerializeClosedImgIndex()
Indicates whether the current value of the ClosedImgIndex property is to be serialized.
Declaration
protected bool ShouldSerializeClosedImgIndex()
Returns
Type | Description |
---|---|
System.Boolean | The ClosedImgIndex value. |
ShouldSerializeEnableValidatingOnLabelEdit()
Declaration
public bool ShouldSerializeEnableValidatingOnLabelEdit()
Returns
Type |
---|
System.Boolean |
ShouldSerializeExpanderType()
Indicates whether the current value of the ExpanderType property is to be serialized or not.
Declaration
protected bool ShouldSerializeExpanderType()
Returns
Type | Description |
---|---|
System.Boolean | The ExpanderType value. |
ShouldSerializeInactiveSelectedNodeBackground()
Indicates whether the current value of the InactiveSelectedNodeBackground property is to be serialized or not.
Declaration
protected bool ShouldSerializeInactiveSelectedNodeBackground()
Returns
Type | Description |
---|---|
System.Boolean | The InactiveSelectedNodeBackground value. |
ShouldSerializeInactiveSelectedNodeForeColor()
Indicates whether the current value of the InactiveSelectedNodeForeColor property is to be serialized or not.
Declaration
protected bool ShouldSerializeInactiveSelectedNodeForeColor()
Returns
Type | Description |
---|---|
System.Boolean | The InactiveSelectedNodeForeColor value. |
ShouldSerializeInteractiveCheckBoxes()
Indicates whether the current value of the InteractiveCheckBoxes property is to be serialized or not.
Declaration
protected bool ShouldSerializeInteractiveCheckBoxes()
Returns
Type | Description |
---|---|
System.Boolean | The InteractiveCheckBoxes value. |
ShouldSerializeIsfromRibbon()
Indicates whether the current value of the Syncfusion.Windows.Forms.Tools.TreeViewAdv.IsFromRibbon property is to be serialized or not.
Declaration
protected bool ShouldSerializeIsfromRibbon()
Returns
Type | Description |
---|---|
System.Boolean | The Syncfusion.Windows.Forms.Tools.TreeViewAdv.IsFromRibbon value. |
ShouldSerializeItemHeight()
Indicates whether the current value of the ItemHeight property is to be serialized or not.
Declaration
protected bool ShouldSerializeItemHeight()
Returns
Type | Description |
---|---|
System.Boolean | The ItemHeight value. |
ShouldSerializeLineColor()
Indicates whether the current value of the LineColor property is to be serialized or not.
Declaration
protected bool ShouldSerializeLineColor()
Returns
Type | Description |
---|---|
System.Boolean | The LineColor value. |
ShouldSerializeNoChildrenImgIndex()
Indicates whether the current value of the NoChildrenImgIndex property is to be serialized or not.
Declaration
protected bool ShouldSerializeNoChildrenImgIndex()
Returns
Type | Description |
---|---|
System.Boolean | The NoChildrenImgIndex value. |
ShouldSerializeOpenImgIndex()
Indicates whether the current value of the OpenImgIndex property is to be serialized or not.
Declaration
protected bool ShouldSerializeOpenImgIndex()
Returns
Type | Description |
---|---|
System.Boolean | The OpenImgIndex value. |
ShouldSerializeSelectedNodeBackground()
Indicates whether the current value of the SelectedNodeBackground property is to be serialized or not.
Declaration
protected bool ShouldSerializeSelectedNodeBackground()
Returns
Type | Description |
---|---|
System.Boolean | The SelectedNodeBackground value. |
ShouldSerializeSelectedNodeForeColor()
Indicates whether the current value of the SelectedNodeForeColor property is to be serialized or not.
Declaration
protected bool ShouldSerializeSelectedNodeForeColor()
Returns
Type | Description |
---|---|
System.Boolean | The SelectedNodeForeColor value. |
ShouldSerializeShowCheckBoxes()
Indicates whether the current value of the ShowCheckBoxes property is to be serialized or not.
Declaration
protected bool ShouldSerializeShowCheckBoxes()
Returns
Type | Description |
---|---|
System.Boolean | The ShowCheckBoxes value. |
ShouldSerializeShowOptionButtons()
Indicates whether the current value of the ShowOptionButtons property is to be serialized or not.
Declaration
protected bool ShouldSerializeShowOptionButtons()
Returns
Type | Description |
---|---|
System.Boolean | The ShowOptionButtons value. |
ShouldSerializeShowPlusMinus()
Indicates whether the current value of the ShowPlusMinus property is to be serialized or not.
Declaration
protected bool ShouldSerializeShowPlusMinus()
Returns
Type | Description |
---|---|
System.Boolean | The ShowPlusMinus value. |
ShouldSerializeShowToolTip()
Represents the current value of the ShowToolTip property is to be serialized or not.
Declaration
public bool ShouldSerializeShowToolTip()
Returns
Type | Description |
---|---|
System.Boolean | The ShowToolTip value. |
ShouldSerializeThemesEnabled()
Indicates whether the current value of the ThemesEnabled property is to be serialized or not.
Declaration
protected bool ShouldSerializeThemesEnabled()
Returns
Type | Description |
---|---|
System.Boolean | The ThemesEnabled value. |
ThemedPaintBackground(Graphics, Rectangle, Rectangle)
Declaration
protected virtual void ThemedPaintBackground(Graphics graphics, Rectangle rect, Rectangle clip)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | graphics | |
System.Drawing.Rectangle | rect | |
System.Drawing.Rectangle | clip |
ToImage()
Gets the image of TreeViewAdv.
Declaration
public Image ToImage()
Returns
Type | Description |
---|---|
System.Drawing.Image | Returns the image. |
UpdateTips(Boolean)
Declaration
protected virtual void UpdateTips(bool mouseHover)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | mouseHover |
WndProc(ref Message)
Overrides System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
Declaration
protected override void WndProc(ref Message m)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | m | The Windows System.Windows.Forms.Message to process. |
Overrides
Events
AfterCheck
Occurs after a node is checked.
Declaration
public event TreeNodeAdvEventHandler AfterCheck
Event Type
Type |
---|
TreeNodeAdvEventHandler |
Remarks
This event will be fired when the node's CheckState property has changed or when a new node has been Optioned.
You could alternatively listen to the individual node's CheckStateChanged event.
AfterCollapse
Occurs after a node has collapsed.
Declaration
public event TreeViewAdvNodeEventHandler AfterCollapse
Event Type
Type |
---|
TreeViewAdvNodeEventHandler |
Remarks
Handle this event when you want to do some processing of the specified node after it's collapsed.
AfterExpand
Occurs after a node is expanded.
Declaration
public event TreeViewAdvNodeEventHandler AfterExpand
Event Type
Type |
---|
TreeViewAdvNodeEventHandler |
Remarks
Handle this event when you want to do some processing of the specified node after it's expanded.
AfterInteractiveChecks
Occurs after one or more node's CheckState has changed due to InteractiveCheckBox setting.
Declaration
public event TreeNodeAdvEventHandler AfterInteractiveChecks
Event Type
Type |
---|
TreeNodeAdvEventHandler |
Remarks
When InteractiveCheckBox is turned on in a parent node, changing the parent's CheckState or one of it's children's will cause the CheckStates of the parent and the child nodes to be updated appropriately. This event will be fired at the end of all these updates.
AfterNodePaint
Fired after a node is being painted when the OwnerDrawNodes property is set to true.
Declaration
public event TreeNodeAdvPaintEventHandler AfterNodePaint
Event Type
Type |
---|
TreeNodeAdvPaintEventHandler |
Remarks
This event is ideal for custom drawing portions of the node in addition to the default drawing. The HandledXXX properties of the event args can be ignored for this event.
AfterSelect
Occurs after a node is selected.
Declaration
public event EventHandler AfterSelect
Event Type
Type |
---|
System.EventHandler |
Remarks
You can determine the selected node using the SelectedNode property.
BeforeCheck
Occurs before a node's check box is checked.
Declaration
public event TreeViewAdvBeforeCheckEventHandler BeforeCheck
Event Type
Type |
---|
TreeViewAdvBeforeCheckEventHandler |
BeforeCollapse
Occurs before a node has collapsed.
Declaration
public event TreeViewAdvCancelableNodeEventHandler BeforeCollapse
Event Type
Type |
---|
TreeViewAdvCancelableNodeEventHandler |
Remarks
Handle this event when you want to do some processing of the specified node before it's collapsed.
BeforeEdit
Occurs before a node gets into the edit mode.
Declaration
public event TreeViewAdvBeforeEditEventHandler BeforeEdit
Event Type
Type |
---|
TreeViewAdvBeforeEditEventHandler |
BeforeExpand
Occurs before a node is expanded.
Declaration
public event TreeViewAdvCancelableNodeEventHandler BeforeExpand
Event Type
Type |
---|
TreeViewAdvCancelableNodeEventHandler |
Remarks
Handle this event when you want to do some processing of the specified node before it's expanded. Use this event when you set the LoadOnDemand property to true to add child nodes to the specified node before it is expanded.
BeforeNodePaint
Fired before a node is being painted when the OwnerDrawNodes property is set to true.
Declaration
public event TreeNodeAdvPaintEventHandler BeforeNodePaint
Event Type
Type |
---|
TreeNodeAdvPaintEventHandler |
Remarks
Handle this event when you want to draw the node yourself. If you set the Handled property to true the TreeViewAdv assumes that you have drawn all the contents of the node and no additional drawing will be done by the TreeViewAdv. If you leave it to false the TreeViewAdv will automatically draw the usual contents of the node. Do not draw the background of the node here. Otherwise it will draw over the vertical line. Use the NodeBackgroundPaint for painting the background.
BeforeSelect
Occurs before a node is selected.
Declaration
public event TreeNodeAdvBeforeSelectEventHandler BeforeSelect
Event Type
Type |
---|
TreeNodeAdvBeforeSelectEventHandler |
Remarks
The collection in the SelectedNodes property is both read-only and fixed size.
Border3DStyleChanged
Occurs when the tree's Border3DStyle is changed.
Declaration
public event EventHandler Border3DStyleChanged
Event Type
Type |
---|
System.EventHandler |
BorderColorChanged
Occurs when the tree's BorderColor is changed.
Declaration
public event EventHandler BorderColorChanged
Event Type
Type |
---|
System.EventHandler |
BorderSidesChanged
Occurs when the tree's BorderSides is changed.
Declaration
public event EventHandler BorderSidesChanged
Event Type
Type |
---|
System.EventHandler |
BorderSingleChanged
Occurs when the tree's Border2DStyle is changed.
Declaration
public event EventHandler BorderSingleChanged
Event Type
Type |
---|
System.EventHandler |
BorderStyleChanged
Occurs when the tree's BorderStyle is changed.
Declaration
public event EventHandler BorderStyleChanged
Event Type
Type |
---|
System.EventHandler |
DataSourceChanged
Occurs when DataSource is changed.
Declaration
public event DataSourceChangedEventHandler DataSourceChanged
Event Type
Type |
---|
DataSourceChangedEventHandler |
DefaultCollapseImageIndexChanged
Occurs when DefaultCollapseImageIndex is changed.
Declaration
public event EventHandler DefaultCollapseImageIndexChanged
Event Type
Type |
---|
System.EventHandler |
DefaultExpandImageIndexChanged
Occurs when DefaultExpandImageIndex is changed.
Declaration
public event EventHandler DefaultExpandImageIndexChanged
Event Type
Type |
---|
System.EventHandler |
DrawNodeCheckBox
Declaration
public event EventHandler<DrawTreeViewAdvNodeEventArgs> DrawNodeCheckBox
Event Type
Type |
---|
System.EventHandler<DrawTreeViewAdvNodeEventArgs> |
EditCancelled
Occurs after the Editing mode gets canceled by Escape key.
Declaration
public event TreeNodeAdvEditEventHandler EditCancelled
Event Type
Type |
---|
TreeNodeAdvEditEventHandler |
GradientBackgroundChanged
Occurs when the tree's GradientBackground is changed.
Declaration
public event EventHandler GradientBackgroundChanged
Event Type
Type |
---|
System.EventHandler |
GradientColorsChanged
Occurs when the tree's GradientColors is changed.
Declaration
public event EventHandler GradientColorsChanged
Event Type
Type |
---|
System.EventHandler |
ItemDrag
Occurs when the user begins a drag of one or more items in the tree view control.
Declaration
public event ItemDragEventHandler ItemDrag
Event Type
Type |
---|
System.Windows.Forms.ItemDragEventHandler |
Remarks
The Item property in the argument is an array of TreeViewAdv nodes that are currently selected.
You can choose to initiate an ole drag-and-drop operation in this event handler.
Examples
To initiate an ole drag-drop in this event handler:
// TreeViewAdv.ItemDrag event listener
private void treeViewAdv1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
// Begin a drag and drop operation of the selected nodes (or some other data).
TreeNodeAdv[] nodes = e.Item as TreeNodeAdv[];
DragDropEffects result = this.DoDragDrop(nodes, DragDropEffects.Copy | DragDropEffects.Move);
// more application logic based on result...
}
' TreeViewAdv.ItemDrag event listener
Private Sub treeViewAdv1_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles treeViewAdv2.ItemDrag
' Begin a drag and drop operation of the selected nodes (or some other data).
Dim nodes As TreeNodeAdv() = CType(e.Item, TreeNodeAdv())
Dim result As DragDropEffects = Me.DoDragDrop(nodes, DragDropEffects.Copy Or DragDropEffects.Move)
' more application logic based on result...
End Sub 'treeViewAdv1_ItemDrag '
Also take a look at our ..\Tools\Samples\Tree Package\TreeViewAdvDragDrop sample for more information on how to turn on drag-drop cues.
NodeBackgroundPaint
Fired to draw the background of a node if the OwnerDrawNodesBackground property is set.
Declaration
public event TreeNodeAdvPaintBackgroundEventHandler NodeBackgroundPaint
Event Type
Type |
---|
TreeNodeAdvPaintBackgroundEventHandler |
Remarks
Handle this event when you want to draw the background of the node yourself.
NodeEditorValidated
Occurs after the newly entered text in the Node editor gets stored.
Declaration
public event TreeNodeAdvEditEventHandler NodeEditorValidated
Event Type
Type |
---|
TreeNodeAdvEditEventHandler |
NodeEditorValidateString
Occurs when the text entered by the user changes in the Node editor control.
Declaration
public event TreeNodeAdvCancelableEditEventHandler NodeEditorValidateString
Event Type
Type |
---|
TreeNodeAdvCancelableEditEventHandler |
NodeEditorValidating
Occurs before the newly entered text in the Node editor gets stored.
Declaration
public event TreeNodeAdvCancelableEditEventHandler NodeEditorValidating
Event Type
Type |
---|
TreeNodeAdvCancelableEditEventHandler |
NodeHotTrackChanged
This event will be triggered when mouse hover occurs in tree nodes and it returns the particular node details which is currently being pointed from its argument.
Declaration
public event TreeViewAdvNodeEventHandler NodeHotTrackChanged
Event Type
Type |
---|
TreeViewAdvNodeEventHandler |
NodeMouseClick
Occurs if single click occurs on TreeNodeAdv.
Declaration
public event TreeNodeAdvMouseClickArgs NodeMouseClick
Event Type
Type |
---|
TreeNodeAdvMouseClickArgs |
NodeMouseDoubleClick
Occurs if double click occurs on TreeNodeAdv.
Declaration
public event TreeNodeAdvMouseClickArgs NodeMouseDoubleClick
Event Type
Type |
---|
TreeNodeAdvMouseClickArgs |
NodeStateImageListChanged
Occurs when NodeStateImageList is changed.
Declaration
public event EventHandler NodeStateImageListChanged
Event Type
Type |
---|
System.EventHandler |
OnNodeAfterFound
Occurs when TreeNodeAdv match is found based on search string.
Declaration
public event TreeViewOnAfterFindArgs OnNodeAfterFound
Event Type
Type |
---|
TreeViewOnAfterFindArgs |
OnNodeBeforeFind
Occurs when TreeNodeAdv match yet to be found based on search string.
Declaration
public event TreeViewOnBeforeFindArgs OnNodeBeforeFind
Event Type
Type |
---|
TreeViewOnBeforeFindArgs |
OnNodeReplaced
Occurs when matched TreeNodeAdv text after gets replaced based on search string.
Declaration
public event TreeViewOnReplacedArgs OnNodeReplaced
Event Type
Type |
---|
TreeViewOnReplacedArgs |
OnNodeReplacing
Occurs when matched TreeNodeAdv text is being replaced based on search string.
Declaration
public event TreeViewOnReplacingArgs OnNodeReplacing
Event Type
Type |
---|
TreeViewOnReplacingArgs |
PaddingChanged
Occurs when the control's padding changes.
Declaration
public event EventHandler PaddingChanged
Event Type
Type |
---|
System.EventHandler |
ThemeChanged
Occurs when the ThemesEnabled property changes
Declaration
public event EventHandler ThemeChanged
Event Type
Type |
---|
System.EventHandler |
ThemeNameChanged
Occurs when theme name of the ContextMenuStripEx has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
Type |
---|
ThemeChangedEventHandler |
VerticalGradientChanged
Occurs when the tree's VerticalGradient is changed.
Declaration
public event EventHandler VerticalGradientChanged
Event Type
Type |
---|
System.EventHandler |
Explicit Interface Implementations
INonClientPaintingSupport.NonClientPaint(PaintEventArgs, Rectangle, Rectangle)
Declaration
IntPtr INonClientPaintingSupport.NonClientPaint(PaintEventArgs e, Rectangle displayRect, Rectangle windowRectInScreen)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | |
System.Drawing.Rectangle | displayRect | |
System.Drawing.Rectangle | windowRectInScreen |
Returns
Type |
---|
System.IntPtr |
IProvideCustomContextMenuPositionalInformation.GetMenuPositionForKeyboardInvoke()
Implement this interface to support keyboard based (Shift+F10) context menu invocation. The context menu will then appear near the selected node.
Declaration
Point IProvideCustomContextMenuPositionalInformation.GetMenuPositionForKeyboardInvoke()
Returns
Type |
---|
System.Drawing.Point |
Remarks
The PopupMenu in the XPMenus framework will then call this method to determine the location for pop-up.
IVisualStyle.VisualTheme
Gets or sets the VisualTheme of the ContextMenuStripEx control.
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |
IThemeProvider.BaseThemeName
Gets or sets the BaseTheme name of the theme
Declaration
string IThemeProvider.BaseThemeName { get; set; }
Returns
Type |
---|
System.String |
IThemeProvider.ControlName
Gets the name of the control.
Declaration
string IThemeProvider.ControlName { get; }
Returns
Type |
---|
System.String |