Class TreeNodeAdv
Represents a node in a TreeViewAdv. It contains information about the specific node like text, background style and other settings.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class TreeNodeAdv : MarshalByRefObject, ICloneable, IComparable, ISupportInitialize, ISerializable, IDisposable
Remarks
The Nodes collection holds all the child TreeNodeAdv objects assigned to the current TreeNodeAdv. You can add, remove or clone a TreeNodeAdv; when doing so, all child tree nodes are added, removed or cloned. Each TreeNodeAdv can contain a collection of other TreeNodeAdv objects. This can make it difficult to determine where you are in the TreeViewAdv when iterating through the collection. To determine your location in a tree structure, use the FullPath property. The FullPath string can be parsed using the PathSeparator string value to determine where a TreeNodeAdv label begins and ends.
The TreeNodeAdv label is set by setting the Text property explicitly. The alternative is to create the tree node using one of the TreeNodeAdv constructors that has a string parameter that represents the Text property.
You can specify images for the node using the LeftImageIndices, OpenImgIndex, ClosedImgIndex, NoChildrenImgIndex and RightImageIndices properties.
The order in which the tree node's contents are drawn is as follows:
- Checkbox
- Option Buttons
- Left images
- State image
- Node Label
- Right images
Selecting specific tree nodes and iterating through the Nodes collection can be achieved by using the following property values: FirstNode, LastNode, NextNode, PrevNode, NextVisibleNode, PrevVisibleNode. Assign the TreeNodeAdv object returned by one of the aforementioned properties to the SelectedNode property to select that tree node in the TreeViewAdv control.
Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the tree node by pressing the plus (+) button next to the TreeNodeAdv, if one is displayed or you can expand the TreeNodeAdv by calling the Expand() method. To expand all child tree node levels in the Nodes collection, call the ExpandAll() method. You can collapse the child TreeNodeAdv level by calling the CollapseAll() method or the user can press the minus (-) button next to the TreeNodeAdv, if one is displayed. You can also alternate the TreeNode between the expanded and collapsed states using the Expanded property.
Examples
The following example displays customer information in a TreeViewAdv control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the TreeViewAdv is suppressed by using the BeginUpdate() and EndUpdate() methods, and a wait Cursor is displayed while the TreeViewAdv creates and paints the TreeNodeAdv objects. This example assumes you have a Customer object that can hold a collection of Order objects. It also assumes that you have created an instance of a TreeViewAdv control on a Form.
// Create a new ArrayList to hold the Customer objects.
private ArrayList customerArray = new ArrayList();
private void FillMyTreeView()
{
// Add customers to the ArrayList of Customer objects.
for(int x=0; x!=1000; x++)
{
customerArray.Add(new Customer("Customer" + x.ToString()));
}
// Add orders to each Customer object in the ArrayList.
foreach(Customer customer1 in customerArray)
{
for(int y=0; y!=15; y++)
{
customer1.CustomerOrders.Add(new Order("Order" + y.ToString()));
}
}
// Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = new Cursor("C:\\Cursors\\MyWait.cur");
// Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear();
// Add a root TreeNodeAdv for each Customer object in the ArrayList.
foreach(Customer customer2 in customerArray)
{
treeViewAdv1.Nodes.Add(new TreeNodeAdv(customer2.CustomerName));
// Add a child treenode for each Order object in the current Customer object.
foreach(Order order1 in customer2.CustomerOrders)
{
treeViewAdv1.Nodes[customerArray.IndexOf(customer2)].Nodes.Add(
new TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID));
}
}
// Reset the cursor to the default for all controls.
Cursor.Current = Cursors.Default;
}
' Create a new ArrayList to hold the Customer objects.
Private customerArray As New ArrayList()
Private Sub FillMyTreeView()
' Add customers to the ArrayList of Customer objects.
Dim x As Integer
For x = 0 To 999
customerArray.Add(New Customer("Customer" + x.ToString()))
Next x
' Add orders to each Customer object in the ArrayList.
Dim customer1 As Customer
For Each customer1 In customerArray
Dim y As Integer
For y = 0 To 14
customer1.CustomerOrders.Add(New Order("Order" + y.ToString()))
Next y
Next customer1
' Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = New Cursor("C:\Cursors\MyWait.cur")
' Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear()
' Add a root TreeNodeAdv for each Customer object in the ArrayList.
Dim customer2 As Customer
For Each customer2 In customerArray
treeViewAdv1.Nodes.Add(New TreeNodeAdv(customer2.CustomerName))
' Add a child TreeNodeAdv for each Order object in the current Customer object.
Dim order1 As Order
For Each order1 In customer2.CustomerOrders
treeViewAdv1.Nodes(customerArray.IndexOf(customer2)).Nodes.Add( _
New TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID))
Next order1
Next customer2
' Reset the cursor to the default for all controls.
Cursor.Current = System.Windows.Forms.Cursors.Default
' Begin repainting the TreeView.
treeViewAdv1.EndUpdate()
End Sub 'FillMyTreeView
Constructors
TreeNodeAdv()
Initializes a new instance of the TreeNodeAdv class.
Declaration
public TreeNodeAdv()
TreeNodeAdv(String)
Initializes a new instance of the TreeNodeAdv class with the specified label text.
Declaration
public TreeNodeAdv(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Passes the text value. |
TreeNodeAdv(String, TreeNodeAdv[])
Initializes a new instance of the TreeNodeAdv class with the specified label text and child tree nodes.
Declaration
public TreeNodeAdv(string text, TreeNodeAdv[] nodes)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Passes the text value. |
TreeNodeAdv[] | nodes | Contains the TreeNodeAdv collection |
Properties
Background
Gets or sets the background of the node.
Declaration
public BrushInfo Background { get; set; }
Property Value
Type |
---|
BrushInfo |
BaseStyle
Gets or sets the base style for the node from which to inherit.
Declaration
public string BaseStyle { get; set; }
Property Value
Type |
---|
System.String |
Remarks
The specified base style should be available in the BaseStyles collection.
Bounds
Gets the bounds of the tree node.
Declaration
public Rectangle Bounds { get; }
Property Value
Type | Description |
---|---|
System.Drawing.Rectangle | The System.Drawing.Rectangle that represents the bounds of the tree node. |
Remarks
The coordinates are relative to the upper left corner of the TreeViewAdv control.
CheckBox
Gets a TreeNodeAdvPart corresponding to the checkbox of a tree node.
Declaration
public TreeNodeAdvPart CheckBox { get; }
Property Value
Type |
---|
TreeNodeAdvPart |
CheckBoxBackGround
Gets or sets the value indicates the appearance of check box background.
Declaration
public Brush CheckBoxBackGround { get; set; }
Property Value
Type |
---|
System.Drawing.Brush |
CheckBoxX
Gets the horizontal distance between the tree border and the beginning of the node's checkbox.
Declaration
public int CheckBoxX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
CheckColor
Gets or sets the value indicates the System.Drawing.Color of the Check mark.
Declaration
public Color CheckColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Checked
Gets or sets the value indicates whether the node's checkbox is checked.
Declaration
public bool Checked { get; set; }
Property Value
Type |
---|
System.Boolean |
CheckState
Gets or sets the CheckState of the node.
Declaration
public CheckState CheckState { get; set; }
Property Value
Type |
---|
System.Windows.Forms.CheckState |
Remarks
Note that setting this property will fire the BeforeCheck event. If you do not want this event to be fired, you can access the tree's internal data structure as follows:
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked;
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked
ChildStyle
Gets the immediate child nodes appearance and state.
Declaration
public TreeNodeAdvStyleInfo ChildStyle { get; }
Property Value
Type |
---|
TreeNodeAdvStyleInfo |
ClosedImgIndex
Gets or sets the image index in the StateImageList where the node is not expanded.
Declaration
public int ClosedImgIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
CollapseImageIndex
Gets or sets image index of image for collapse button.
Declaration
public int CollapseImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
CompareOptions
Gets or sets the compare options used in the sorting of the node.
Declaration
public CompareOptions CompareOptions { get; set; }
Property Value
Type |
---|
System.Globalization.CompareOptions |
Comparer
Gets or sets the System.Collections.IComparer object that compares two nodes.
Declaration
public IComparer Comparer { get; set; }
Property Value
Type |
---|
System.Collections.IComparer |
Culture
Gets or sets the culture of the node.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type |
---|
System.Globalization.CultureInfo |
CustomControl
Gets or sets node custom control.
Declaration
public Control CustomControl { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Control |
CustomControlLocation
Gets or sets the location for the custom control.
Declaration
public Point CustomControlLocation { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
DragCueBounds
Gets the DragCueBounds.
Declaration
public Rectangle DragCueBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
Enabled
Gets or sets the value indicates whether the node is enabled.
Declaration
public bool Enabled { get; set; }
Property Value
Type |
---|
System.Boolean |
EnabledButtons
Gets or sets the value indicates whether the buttons in the node are enabled.
Declaration
public bool EnabledButtons { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to enable the buttons; False otherwise. |
Remarks
The checkbox and option buttons can be disabled keeping the rest of the node enabled using this property.
EnsureDefaultOptionedChild
Gets or sets the value indicates whether the first child should be marked as Optioned and this node's OptionedChild if none of the other children is Optioned in a parent node.
Declaration
public bool EnsureDefaultOptionedChild { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to ensure a default optioned child; False otherwise. |
Expanded
Gets or sets the value indicates whether the expanded state of a tree node.
Declaration
public bool Expanded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the tree node is in the expanded state; false otherwise. |
ExpandedOnce
Gets or sets the value indicates whether the node has been expanded at least once.
Declaration
public bool ExpandedOnce { get; set; }
Property Value
Type |
---|
System.Boolean |
ExpandImageIndex
Gets or sets image index of image for expand button.
Declaration
public int ExpandImageIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
FirstNode
Gets the first child tree node in the tree node collection.
Declaration
public TreeNodeAdv FirstNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | The first child TreeNodeAdv in the Nodes collection. |
Remarks
The FirstNode is the first child TreeNodeAdv in the TreeNodeAdvCollection stored in the Nodes property of the current tree node. If the System.Windows.Forms.TreeNode has no child tree node, the FirstNode property returns a null reference (Nothing in Visual Basic).
Font
Gets or sets the font of the node.
Declaration
public Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
FullPath
Gets the path from the root tree node to the current tree node.
Declaration
public string FullPath { get; }
Property Value
Type | Description |
---|---|
System.String | The path from the root tree node to the current tree node. |
Remarks
You can also use the more flexible GetPath(String) method to get the path with a specific path separator.
The path consists of the labels of all of the tree nodes that must be navigated to get to this tree node, starting at the root tree node. The node labels are separated by the delimiter character specified in the PathSeparator property of the TreeViewAdv control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\), the FullPath property value is "Country\Region\State".
HasChildren
Gets the value indicates whether the node has child nodes.
Declaration
public bool HasChildren { get; }
Property Value
Type |
---|
System.Boolean |
Height
Gets or sets the height of the node.
Declaration
public int Height { get; set; }
Property Value
Type |
---|
System.Int32 |
HelpText
Gets or sets the help text of the node.
Declaration
public string HelpText { get; set; }
Property Value
Type |
---|
System.String |
HistoryManager
Returns the TreeView History manager this node belongs to.
Declaration
protected HistoryManager HistoryManager { get; }
Property Value
Type |
---|
HistoryManager |
Index
Gets the position of the tree node in the Parent's tree node collection.
Declaration
public int Index { get; }
Property Value
Type |
---|
System.Int32 |
InteractiveCheckBox
Gets or sets value indicates whether the node will have an interactive checkbox.
Declaration
public bool InteractiveCheckBox { get; set; }
Property Value
Type |
---|
System.Boolean |
IntermediateCheckBoxBackGround
Gets or sets the value indicates the appearance of check box background when the check box is in intermediate state.
Declaration
public Brush IntermediateCheckBoxBackGround { get; set; }
Property Value
Type |
---|
System.Drawing.Brush |
IntermediateCheckColor
Gets or sets the value indicates the System.Drawing.Color of the check mark when it is in intermediate state.
Declaration
public Color IntermediateCheckColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
IsActiveNode
Gets the value indicates whether the node is the currently active node.
Declaration
public bool IsActiveNode { get; }
Property Value
Type |
---|
System.Boolean |
IsEditing
Gets the value indicates whether the node is in editing state.
Declaration
public bool IsEditing { get; }
Property Value
Type |
---|
System.Boolean |
IsSelectable
Gets or sets whether the node to be selected or not.
Declaration
public bool IsSelectable { get; set; }
Property Value
Type |
---|
System.Boolean |
IsSelected
Gets the value indicates whether the node is selected.
Declaration
public bool IsSelected { get; }
Property Value
Type |
---|
System.Boolean |
IsUndoRedoPerforming
Indicates whether the node is in UndoRedo state.
Declaration
protected bool IsUndoRedoPerforming { get; set; }
Property Value
Type |
---|
System.Boolean |
IsVisible
Gets the value indicates whether the tree node is visible.
Declaration
public bool IsVisible { get; }
Property Value
Type |
---|
System.Boolean |
LabelEdit
Gets or sets the value indicates whether to allow Node Editing and this is applicable only when LabelEdit is enabled in TreeViewAdv.
Declaration
public virtual bool LabelEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the label text of the tree node can be edited; false otherwise. |
LastNode
Gets the last child tree node in the tree node collection.
Declaration
public TreeNodeAdv LastNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | The last child TreeNodeAdv in the Nodes collection. |
Remarks
The LastNode is the last child TreeNodeAdv in the TreeNodeAdvCollection stored in the Nodes property of the current tree node. If the TreeNodeAdv has no child tree node, the LastNode property returns a null reference (Nothing in Visual Basic).
LeftImageIndices
Gets or sets the image indices of the images to be drawn on the left of the node's text.
Declaration
public int[] LeftImageIndices { get; set; }
Property Value
Type |
---|
System.Int32[] |
LeftImagePadding
Gets or sets the space between images for LeftImageList.
Declaration
public int LeftImagePadding { get; set; }
Property Value
Type |
---|
System.Int32 |
LeftImagesX
Gets the horizontal distance between the tree border and the beginning of the node's left images.
Declaration
public int LeftImagesX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
LeftStateImagePadding
Gets or sets the space before StateImage.
Declaration
public int LeftStateImagePadding { get; set; }
Property Value
Type |
---|
System.Int32 |
Level
Gets the level of the node.
Declaration
public int Level { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
Specifies how deep a node is in the tree. The top-most visible nodes belong to level 1. The Root node is level 0.
MultiLine
Gets or sets the MultiLine of the node.
Declaration
public bool MultiLine { get; set; }
Property Value
Type |
---|
System.Boolean |
Name
Gets or sets the name of the TreeNodeAdv.
Declaration
public string Name { get; set; }
Property Value
Type |
---|
System.String |
NextNode
Gets the next sibling tree node.
Declaration
public TreeNodeAdv NextNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the next sibling tree node. |
Remarks
The NextNode is the next sibling TreeNodeAdv in the System.Windows.Forms.TreeNodeCollection stored in the Nodes property of the tree node's parent TreeNodeAdv. If there is no next tree node, the NextNode property returns a null reference (Nothing in Visual Basic).
NextSelectableNode
Gets the next selectable tree node.
Declaration
public TreeNodeAdv NextSelectableNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the next selectable tree node. |
Remarks
The NextSelectableNode can be a child, sibling or a tree node from another branch. If there is no next tree node, the NextSelectableNode property returns a null reference (Nothing in Visual Basic).
NextVisibleNode
Gets the next visible tree node.
Declaration
public TreeNodeAdv NextVisibleNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the next visible tree node. |
Remarks
The NextVisibleNode can be a child, sibling or a tree node from another branch. If there is no next tree node, the NextVisibleNode property returns a null reference (Nothing in Visual Basic).
NoChildrenImgIndex
Gets or sets the image index indicates the image in the StateImageList where the node has no children.
Declaration
public int NoChildrenImgIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Nodes
Gets the collection of TreeNodeAdv objects assigned to the current tree node.
Declaration
public TreeNodeAdvCollection Nodes { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdvCollection | A TreeNodeAdvCollection that represents the tree nodes assigned to the current tree node. |
Remarks
The Nodes property can hold a collection of other TreeNodeAdv objects. Each of the tree node in the collection has a Nodes property that can contain its own TreeNodeAdvCollection. This nesting of tree nodes can make it difficult to navigate a tree structure. The FullPath property makes it easier to determine your location in a tree.
NodeStyle
Gets the node's appearance and state.
Declaration
public TreeNodeAdvStyleInfo NodeStyle { get; }
Property Value
Type |
---|
TreeNodeAdvStyleInfo |
Remarks
This property exposes the nodes style information store.
NodeX
Gets the horizontal distance between the tree border and the beginning of the node's drawing bounds.
Declaration
public int NodeX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
OpenImgIndex
Gets or sets the image index in the StateImageList where the node is expanded.
Declaration
public int OpenImgIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
OptionButton
Gets a TreeNodeAdvPart corresponding to the option button part of a tree node.
Declaration
public TreeNodeAdvPart OptionButton { get; }
Property Value
Type |
---|
TreeNodeAdvPart |
OptionButtonColor
Gets or sets the value indicates whether the System.Drawing.Color of the Option button.
Declaration
public Color OptionButtonColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
OptionButtonX
Gets the horizontal distance between the tree border and the beginning of the node's option button.
Declaration
public int OptionButtonX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
Optioned
Gets or sets the value indicates whether the node's option button is checked.
Declaration
public bool Optioned { get; set; }
Property Value
Type |
---|
System.Boolean |
OptionedChild
Gets the child node who's option button is checked.
Declaration
public TreeNodeAdv OptionedChild { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the next visible tree node. |
Parent
Gets the parent tree node of the current tree node, if there is any.
Declaration
public TreeNodeAdv Parent { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the parent of the current tree node. |
Remarks
If this is the top most node in the tree, the Parent property returns the TreeViewAdv's Root node.
PartsPadX
Gets the horizontal padding used between the different parts of the tree node.
Declaration
public static int PartsPadX { get; }
Property Value
Type |
---|
System.Int32 |
PlusMinus
Gets a TreeNodeAdvPart corresponding to the plus-minus part of a tree node.
Declaration
public TreeNodeAdvPart PlusMinus { get; }
Property Value
Type |
---|
TreeNodeAdvPart |
PlusMinusSize
Gets or sets the Size of the PlusMinus.
Declaration
public Size PlusMinusSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
PrevNode
Gets the previous sibling tree node.
Declaration
public TreeNodeAdv PrevNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the previous sibling tree node. |
Remarks
The PrevNode is the previous sibling TreeNodeAdv in the TreeNodeAdvCollection stored in the Nodes property of the tree node's parent TreeNodeAdv. If there is no previous tree node, the PrevNode property returns a null reference (Nothing in Visual Basic).
PrevSelectableNode
Gets the previous selectable tree node.
Declaration
public TreeNodeAdv PrevSelectableNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the previous selectable tree node. |
Remarks
The PrevSelectableNode can be a child, sibling or a tree node from another branch. If there is no previous tree node, the PrevSelectableNode property returns a null reference (Nothing in Visual Basic).
PrevVisibleNode
Gets the previous visible tree node.
Declaration
public TreeNodeAdv PrevVisibleNode { get; }
Property Value
Type | Description |
---|---|
TreeNodeAdv | A TreeNodeAdv that represents the previous visible tree node. |
Remarks
The PrevVisibleNode can be a child, sibling or a tree node from another branch. If there is no previous tree node, the PrevVisibleNode property returns a null reference (Nothing in Visual Basic).
Primitives
A collection that contains Primitives objects.
Declaration
public TreeNodePrimitivesCollection Primitives { get; }
Property Value
Type |
---|
TreeNodePrimitivesCollection |
PrintTextBounds
Declaration
protected Rectangle PrintTextBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
RightImageIndices
Gets or sets the image indices of the images to be drawn on the right of the node's text.
Declaration
public int[] RightImageIndices { get; set; }
Property Value
Type |
---|
System.Int32[] |
RightImagePadding
Gets or sets the space between images for RightImageList.
Declaration
public int RightImagePadding { get; set; }
Property Value
Type |
---|
System.Int32 |
RightImagesX
Gets the horizontal distance between the tree border and the beginning of the node's right images.
Declaration
public int RightImagesX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
RightStateImagePadding
Gets or sets the space after StateImage.
Declaration
public int RightStateImagePadding { get; set; }
Property Value
Type |
---|
System.Int32 |
SelectedOptionButtonColor
Gets or sets the value indicates whether the System.Drawing.Color of the Option button in selected state.
Declaration
public Color SelectedOptionButtonColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
ShowCheckBox
Gets or sets the value indicates whether the checkbox of the node is visible.
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowLine
Gets or sets the ShowLine of the TreeNodeAdv.
Declaration
public bool ShowLine { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowOptionButton
Gets or sets the value indicateing whether the option button of the node is visible.
Declaration
public bool ShowOptionButton { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowPlusMinus
Gets or sets the value indicates whether the plus or minus of the node is visible.
Declaration
public bool ShowPlusMinus { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowPlusOnExpand
Gets or sets show plus on expand. Use only on LoadOnDemand mode.
Declaration
public bool ShowPlusOnExpand { get; set; }
Property Value
Type |
---|
System.Boolean |
SortOrder
Gets or sets the sort order of the node.
Declaration
public SortOrder SortOrder { get; set; }
Property Value
Type |
---|
System.Windows.Forms.SortOrder |
SortType
Gets or sets the sort type of the node.
Declaration
public TreeNodeAdvSortType SortType { get; set; }
Property Value
Type |
---|
TreeNodeAdvSortType |
StateImageX
Gets the horizontal distance between the tree border and the beginning of the node's state image.
Declaration
public int StateImageX { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
This property returns a valid value only when queried from an owner draw paint event like AfterNodePaint.
Tag
Gets or sets the object that contains data about the tree node.
Declaration
public object Tag { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An System.Object that contains data about the tree node. The default is a null reference (Nothing in Visual Basic). |
Remarks
Any Object derived type may be assigned to this property. If this property is being set through the Windows Forms designer, only text may be assigned.
When the tree node is cloned, if this object is cloneable (implements ICloneable interface) then it will be.
TagObject
Gets or sets the object that contains data about the tree node.
Declaration
public object TagObject { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An System.Object that contains data about the tree node. The default is a null reference (Nothing in Visual Basic). |
Text
Gets or sets the text of the node.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |
TextAndImageBounds
Gets the bounds of the left images, state images, text area and the right images of the node.
Declaration
public Rectangle TextAndImageBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
TextBounds
Gets the bounds of the text area of the node.
Declaration
public Rectangle TextBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
TextColor
Gets or sets the color of the text.
Declaration
public Color TextColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
ThemesEnabled
Gets or sets the value indicates whether the node's controls will be themed.
Declaration
public bool ThemesEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
TreeView
Gets or sets the parent TreeViewAdv that the tree node is assigned to.
Declaration
public TreeViewAdv TreeView { get; set; }
Property Value
Type | Description |
---|---|
TreeViewAdv | A TreeViewAdv that represents the parent tree view that the tree node is assigned to. |
Methods
BringIntoView()
Expands parent nodes to make this node visible and also scrolls the tree such that this node is brought into view.
Declaration
public void BringIntoView()
Clone()
Represents to creates a clone of this node.
Declaration
public TreeNodeAdv Clone()
Returns
Type | Description |
---|---|
TreeNodeAdv | The clone of the node. |
CloneCustomControl(Control)
Represents clone the custom control for TreeNodeAdv.
Declaration
public Control CloneCustomControl(Control ctrl)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | ctrl | The control needs to be cloned. |
Returns
Type |
---|
System.Windows.Forms.Control |
Collapse()
Collapses this node
Declaration
public void Collapse()
CollapseAll()
Collapses this node and all it's children.
Declaration
public void CollapseAll()
CreateControlInstance(String, String)
Represents control instance for TreeNodeAdv.
Declaration
public Control CreateControlInstance(string controlName, string namespaceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controlName | Create the control with specified name. |
System.String | namespaceName | Specifies the namespace name |
Returns
Type |
---|
System.Windows.Forms.Control |
Dispose()
Dispose the TreeNodeAdv.
Declaration
public void Dispose()
Dispose(Boolean)
TreeNodeAdv Virtual Dispose
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing |
DrawFocusRect(Graphics, TreeViewAdv)
Draws dotted border around selected node. This will be used to fast drawing when TreeCtrl loses focus.
Declaration
protected void DrawFocusRect(Graphics g, TreeViewAdv tvaTree)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Device context needed for drawing. |
TreeViewAdv | tvaTree | Node's parent. |
Expand()
Expands the node.
Declaration
public void Expand()
ExpandAll()
Expands this node and all the subnodes.
Declaration
public void ExpandAll()
Finalize()
Destructor
Declaration
protected void Finalize()
GetNextNode()
Returns the next node from the parent treenode.
Declaration
public TreeNodeAdv GetNextNode()
Returns
Type | Description |
---|---|
TreeNodeAdv | TreeNodeAdv that represents the next node from the current treenode. |
Remarks
This method will returns the next node regardless whether the node is collapsed state or not.
GetNodeCount(Boolean)
Returns the number of child tree nodes.
Declaration
public int GetNodeCount(bool includeSubTrees)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeSubTrees | True if the resulting count includes all tree nodes indirectly rooted at this tree node; false otherwise. |
Returns
Type | Description |
---|---|
System.Int32 | The number of child tree nodes assigned to the Nodes collection. |
GetObjectData(SerializationInfo, StreamingContext)
Populates the provided SerializationInfo with the data needed to serialize the object .
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | Stores all the data needed to serialize or de-serialize an object. |
System.Runtime.Serialization.StreamingContext | context | The source and destination of a given serialized stream, and provides an additional caller-defined context. |
GetOptionedChild()
Returns the child node who's option button is checked.
Declaration
protected TreeNodeAdv GetOptionedChild()
Returns
Type |
---|
TreeNodeAdv |
GetPath(String)
Returns the path of the node.
Declaration
public string GetPath(string separator)
Parameters
Type | Name | Description |
---|---|---|
System.String | separator | The separator string. |
Returns
Type | Description |
---|---|
System.String | The path of the node. |
Remarks
You can also use the FullPath property to get the full path with the path separator specified in the PathSeparator property.
HasNode(TreeNodeAdv)
Indicates whether node is contained in it's nodes collection or in it's subnodes nodes collection.
Declaration
public bool HasNode(TreeNodeAdv node)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | node | Node to look for. |
Returns
Type | Description |
---|---|
System.Boolean | True if node is contained. |
IsParent(TreeNodeAdv)
Indicates whether the current node is a direct or indirect child of the specified node.
Declaration
public bool IsParent(TreeNodeAdv targetNode)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | targetNode | The node that is to be tested for ancestry. |
Returns
Type | Description |
---|---|
System.Boolean | True if the targetNode is a parent of this node; False otherwise. |
Move(TreeNodeAdv, NodePositions)
Moves the node to a specified position in relation to the specified relative node.
Declaration
public void Move(TreeNodeAdv relativeNode, NodePositions nodePosition)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdv | relativeNode | The "relative node" that determines this node's new position. |
NodePositions | nodePosition | Specifies where this node will be moved in relation to the "relative node". |
Remarks
A node can be positioned relative to any other node in the same tree or even a different TreeViewAdv Control.
Move(TreeNodeAdvCollection)
Moves the node to the end of the specified collection.
Declaration
public void Move(TreeNodeAdvCollection newNodesCollection)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvCollection | newNodesCollection | A TreeNodeAdvCollection to which this node will move. |
Remarks
A node can be positioned to any other TreeNodeAdvCollection in the same tree or in a different TreeViewAdv control.
Note: All of the descendants of the node will move along with it.
Note: A node cannot be moved to one of it's own Descendants.
Move(TreeNodeAdvCollection, NodePositions)
Moves the node to a specified position in relation to the specified relative node.
Declaration
public void Move(TreeNodeAdvCollection col, NodePositions nodePosition)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvCollection | col | |
NodePositions | nodePosition |
Move(TreeNodeAdvCollection, Int32)
Moves the node to a new collection at the specified index.
Declaration
public void Move(TreeNodeAdvCollection newNodesCollection, int index)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvCollection | newNodesCollection | A TreeNodeAdvCollection to which this node will move. |
System.Int32 | index | The new index of the node in the new collection. |
Remarks
Moving a node by index will ensure that the node ends up at the index specified. Note that the node will first be removed from its existing collection and then added to the specified collection at the specified index. If the source collection and destination collection are the same, make sure to take into account the above semantics while specifying the index, or use the Move override that lets you specify a relative position.
OnCheckStateChanged(EventArgs)
Raises the CheckStateChanged event.
Declaration
protected virtual void OnCheckStateChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
The OnCheckStateChanged 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 OnCheckStateChanged in a derived class, be sure to call the base class's OnCheckStateChanged method so that registered delegates receive the event.
OnCollapseImageIndexChanged()
Raises the CollapseImageIndexChanged event.
Declaration
protected virtual void OnCollapseImageIndexChanged()
OnExpandImageIndexChanged()
Raises the ExpandImageIndexChanged event.
Declaration
protected virtual void OnExpandImageIndexChanged()
OnLeftImagePaddingChanged()
Determines whether the distance between the node's text and Leftimage is changed.
Declaration
protected virtual void OnLeftImagePaddingChanged()
OnRightImagePaddingChanged()
Determines whether the distance between the node's text and Rightimage is changed.
Declaration
protected virtual void OnRightImagePaddingChanged()
OnStateImagePaddingChanged()
Declaration
protected virtual void OnStateImagePaddingChanged()
RecalculateAllDimensions()
Recalculates the dimensions of all the UI elements in this node and it's children.
Declaration
public void RecalculateAllDimensions()
Remove()
Removes itself from the parent node, if there is any.
Declaration
public void Remove()
ResetBackground()
Resets the Background property to it's default value.
Declaration
public void ResetBackground()
ResetBaseStyle()
Resets the BaseStyle property to it's default value.
Declaration
public void ResetBaseStyle()
ResetCheckState()
Resets the CheckState property to it's default value.
Declaration
public void ResetCheckState()
ResetClosedImgIndex()
Resets the ClosedImgIndex property to it's default value.
Declaration
public void ResetClosedImgIndex()
ResetCompareOptions()
Resets the CompareOptions property to it's default value.
Declaration
public void ResetCompareOptions()
ResetComparer()
Resets the Comparer property to it's default value.
Declaration
public void ResetComparer()
ResetCulture()
Resets the Culture property to it's default value.
Declaration
public void ResetCulture()
ResetCustomControlLocation()
Reset the Custom control location of TreeNodeAdv.
Declaration
public void ResetCustomControlLocation()
ResetEnabled()
Resets the Enabled property to it's default value.
Declaration
public void ResetEnabled()
ResetEnabledButtons()
Resets the EnabledButtons property to it's default value.
Declaration
public void ResetEnabledButtons()
ResetEnsureDefaultOptinedChild()
Resets the EnsureDefaultOptionedChild property to its default value.
Declaration
[Obsolete("ResetEnsureDefaultOptinedChild is deprecated, please use ResetEnsureDefaultOptionedChild instead.")]
public void ResetEnsureDefaultOptinedChild()
ResetEnsureDefaultOptionedChild()
Resets the EnsureDefaultOptionedChild property to its default value.
Declaration
public void ResetEnsureDefaultOptionedChild()
ResetFont()
Resets the Font property to it's default value.
Declaration
public void ResetFont()
ResetHeight()
Resets the Height property to it's default value.
Declaration
public void ResetHeight()
ResetHelpText()
Resets the HelpText property to it's default value.
Declaration
public void ResetHelpText()
ResetInteractiveCheckBox()
Resets the InteractiveCheckBox property to it's default value.
Declaration
public void ResetInteractiveCheckBox()
ResetLeftImageIndices()
Resets the LeftImageIndices property to it's default value.
Declaration
public void ResetLeftImageIndices()
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()
ResetRightImageIndices()
Resets the RightImageIndices property to it's default value.
Declaration
public void ResetRightImageIndices()
ResetShowCheckBox()
Resets the ShowCheckBox property to it's default value.
Declaration
public void ResetShowCheckBox()
ResetShowOptionButton()
Resets the ShowOptionButton property to it's default value.
Declaration
public void ResetShowOptionButton()
ResetShowPlusMinus()
Resets the ShowPlusMinus property to it's default value.
Declaration
public void ResetShowPlusMinus()
ResetSortOrder()
Resets the SortOrder property to it's default value.
Declaration
public void ResetSortOrder()
ResetSortType()
Resets the SortType property to it's default value.
Declaration
public void ResetSortType()
ResetTag()
Resets the Tag property to it's default value.
Declaration
public void ResetTag()
ResetText()
Resets the Text property to it's default value.
Declaration
public void ResetText()
ResetTextColor()
Resets the TextColor property to it's default value.
Declaration
public void ResetTextColor()
ResetThemesEnabled()
Resets the ThemesEnabled property to it's default value.
Declaration
public void ResetThemesEnabled()
SetControlProperties(Control, Hashtable)
Specifies the control properties for TreeNodeAdv.
Declaration
public void SetControlProperties(Control ctrl, Hashtable propertyList)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Control | ctrl | Defines the control |
System.Collections.Hashtable | propertyList | Holds the property list. |
ShouldSerializeBackground()
Declaration
protected bool ShouldSerializeBackground()
Returns
Type |
---|
System.Boolean |
ShouldSerializeBaseStyle()
Declaration
protected bool ShouldSerializeBaseStyle()
Returns
Type |
---|
System.Boolean |
ShouldSerializeCheckState()
Declaration
protected bool ShouldSerializeCheckState()
Returns
Type |
---|
System.Boolean |
ShouldSerializeClosedImgIndex()
Declaration
protected bool ShouldSerializeClosedImgIndex()
Returns
Type |
---|
System.Boolean |
ShouldSerializeCompareOptions()
Declaration
protected bool ShouldSerializeCompareOptions()
Returns
Type |
---|
System.Boolean |
ShouldSerializeComparer()
Declaration
protected bool ShouldSerializeComparer()
Returns
Type |
---|
System.Boolean |
ShouldSerializeCulture()
Declaration
protected bool ShouldSerializeCulture()
Returns
Type |
---|
System.Boolean |
ShouldSerializeCustomControlLocation()
Serializes the custom control location.
Declaration
protected bool ShouldSerializeCustomControlLocation()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the location is empty. |
ShouldSerializeEnabled()
Declaration
protected bool ShouldSerializeEnabled()
Returns
Type |
---|
System.Boolean |
ShouldSerializeEnabledButtons()
Declaration
protected bool ShouldSerializeEnabledButtons()
Returns
Type |
---|
System.Boolean |
ShouldSerializeEnsureDefaultOptinedChild()
Determines if the EnsureDefaultOptionedChild property was modified.
Declaration
protected bool ShouldSerializeEnsureDefaultOptinedChild()
Returns
Type |
---|
System.Boolean |
ShouldSerializeFont()
Indicates whether the current value of the Font property is to be serialized.
Declaration
public bool ShouldSerializeFont()
Returns
Type | Description |
---|---|
System.Boolean | The Font value. |
ShouldSerializeHeight()
Declaration
protected bool ShouldSerializeHeight()
Returns
Type |
---|
System.Boolean |
ShouldSerializeHelpText()
Declaration
protected bool ShouldSerializeHelpText()
Returns
Type |
---|
System.Boolean |
ShouldSerializeInteractiveCheckBox()
Declaration
protected bool ShouldSerializeInteractiveCheckBox()
Returns
Type |
---|
System.Boolean |
ShouldSerializeLeftImageIndices()
Declaration
protected bool ShouldSerializeLeftImageIndices()
Returns
Type |
---|
System.Boolean |
ShouldSerializeMultiLine()
Declaration
protected bool ShouldSerializeMultiLine()
Returns
Type |
---|
System.Boolean |
ShouldSerializeName()
Serializes Name property
Declaration
protected bool ShouldSerializeName()
Returns
Type |
---|
System.Boolean |
ShouldSerializeNoChildrenImgIndex()
Declaration
protected bool ShouldSerializeNoChildrenImgIndex()
Returns
Type |
---|
System.Boolean |
ShouldSerializeOpenImgIndex()
Declaration
protected bool ShouldSerializeOpenImgIndex()
Returns
Type |
---|
System.Boolean |
ShouldSerializeRightImageIndices()
Declaration
protected bool ShouldSerializeRightImageIndices()
Returns
Type |
---|
System.Boolean |
ShouldSerializeShowCheckBox()
Declaration
protected bool ShouldSerializeShowCheckBox()
Returns
Type |
---|
System.Boolean |
ShouldSerializeShowOptionButton()
Declaration
protected bool ShouldSerializeShowOptionButton()
Returns
Type |
---|
System.Boolean |
ShouldSerializeShowPlusMinus()
Declaration
protected bool ShouldSerializeShowPlusMinus()
Returns
Type |
---|
System.Boolean |
ShouldSerializeSortOrder()
Declaration
protected bool ShouldSerializeSortOrder()
Returns
Type |
---|
System.Boolean |
ShouldSerializeSortType()
Declaration
protected bool ShouldSerializeSortType()
Returns
Type |
---|
System.Boolean |
ShouldSerializeTag()
Declaration
protected bool ShouldSerializeTag()
Returns
Type |
---|
System.Boolean |
ShouldSerializeText()
Declaration
protected bool ShouldSerializeText()
Returns
Type |
---|
System.Boolean |
ShouldSerializeTextColor()
Indicates whether the current value of the TextColor property is to be serialized.
Declaration
public bool ShouldSerializeTextColor()
Returns
Type |
---|
System.Boolean |
ShouldSerializeThemesEnabled()
Declaration
protected bool ShouldSerializeThemesEnabled()
Returns
Type |
---|
System.Boolean |
Sort()
Declaration
public void Sort()
Sort(TreeNodeAdvSortType)
Sorts the tree nodes with the specified sort type and the current
Declaration
public void Sort(TreeNodeAdvSortType sortType)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeAdvSortType | sortType | One of the TreeNodeAdvSortType value. |
Remarks
This will also set the value in the
ToggleCheckState(Boolean)
Declaration
protected void ToggleCheckState(bool multiNodeToggle)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | multiNodeToggle |
Events
BeforePopupHelpText
Occurs before a popup of the TreeNodeAdv HelpText is opened.
Declaration
public event CancelEventHandler BeforePopupHelpText
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
CheckStateChanged
Occurs when the check state of the node changes.
Declaration
public event EventHandler CheckStateChanged
Event Type
Type |
---|
System.EventHandler |
Remarks
This event will be fired when the CheckedState property of the node has changed or when a new node has been Optioned.
You could alternatively listen to the AfterCheck event of the tree which will be called when the CheckState is changing for any node in the tree. If you want to cancel the check state change, then listen to BeforeCheck of the tree.
CollapseImageIndexChanged
Occurs when CollapseImageIndex is changed.
Declaration
public event EventHandler CollapseImageIndexChanged
Event Type
Type |
---|
System.EventHandler |
ExpandImageIndexChanged
Occurs when ExpandImageIndex is changed.
Declaration
public event EventHandler ExpandImageIndexChanged
Event Type
Type |
---|
System.EventHandler |
Explicit Interface Implementations
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type |
---|
System.Object |
IComparable.CompareTo(Object)
Declaration
int IComparable.CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type |
---|
System.Int32 |