Gets/sets a value indicating whether the selected tree node (or nodes)
remains highlighted when the
UltraTree has lost the focus.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Property HideSelection As Boolean |
| C# | |
|---|
public bool HideSelection {get; set;} |
Example
The following sample code initializes various properties on an UltraWinTree control and illustrates how to populate the tree.
| Visual Basic | Copy Code |
|---|
Imports Infragistics.Win.UltraWinTree
Private Sub InitializeTreeControl()
With Me.ultraTree1
.AllowAutoDragScrolling = True
.AllowKeyboardSearch = True
.AutoDragExpandDelay = 500
.BorderStyle = Infragistics.Win.UIElementBorderStyle.InsetSoft
.FullRowSelect = False
.HideSelection = True
.ImagePadding = 3
.Indent = 8
.LeftImagesSize = New Size(12, 12)
.RightImagesSize = New Size(8, 8)
.NodeConnectorColor = Color.Red
.NodeConnectorStyle = NodeConnectorStyle.Dotted
.PathSeparator = "\"
.Scrollable = Scrollbar.ShowIfNeeded
.ShowLines = True
.ShowRootLines = True
Dim node As UltraTreeNode
Dim childNode As UltraTreeNode
node = .Nodes.Add("Node 1")
childNode = node.Nodes.Add("child node 1")
childNode.Nodes.Add("child child 1")
childNode.Nodes.Add("child child 2")
childNode.Nodes.Add("child child 3")
childNode = node.Nodes.Add("child node 2")
childNode = node.Nodes.Add("child node 3")
childNode.Enabled = False
childNode = node.Nodes.Add("child node 4")
node = .Nodes.Add("Node 2")
.ActiveNode = childNode
.ActiveNode.BringIntoView()
End With
End Sub
|
| C# | Copy Code |
|---|
using Infragistics.Win.UltraWinTree;
private void InitializeTreeControl()
{
// Set various properties on the tree control
// Specify whether the tree will scroll during a
// drag operation
this.ultraTree1.AllowAutoDragScrolling =
true;
// Specify whether the tree will look for the
// next matching node as the user types.
this.ultraTree1.AllowKeyboardSearch =
true;
// Specify the amount of milliseconds to wait
// before expanding a node during a drag
// operation.
this.ultraTree1.AutoDragExpandDelay =
500;
// Set the border style of the control
this.ultraTree1.BorderStyle =
Infragistics.Win.UIElementBorderStyle.InsetSoft;
// Specify whether clicking anywhere on the
// row the node is on will select the node.
this.ultraTree1.FullRowSelect =
false;
// Specify whether selected nodes remain
// highlighted when the tree loses focus.
this.ultraTree1.HideSelection =
true;
// Specify the padding around images in pixels.
this.ultraTree1.ImagePadding = 3;
// Specify how many pixels to indent each
// node level.
this.ultraTree1.Indent = 8;
// Specify the default size of images that will
// appear to the left and right of a node's text.
this.ultraTree1.LeftImagesSize =
new Size(12,12);
this.ultraTree1.RightImagesSize =
new Size(8,8);
// Specify the style and color os the node
// connector lines.
this.ultraTree1.NodeConnectorColor =
Color.Red;
this.ultraTree1.NodeConnectorStyle =
NodeConnectorStyle.Dotted;
// Specify the string to be used to separate
// ancestor nodes when getting a node's
// 'FullPath' property. For example:
//this.ultraTree1.ActiveNode.FullPath;
this.ultraTree1.PathSeparator =
@"\";
// Specify whether scrollbars will be shown
this.ultraTree1.Scrollable =
Scrollbar.ShowIfNeeded;
// Specify whether lines will appear between nodes
this.ultraTree1.ShowLines = true;
// Specify whether room for lines and expansion
// indicators will be reserved to the left of root
// nodes (i.e. nodes without a parent node).
//
// Note: If the 'ShowLines' property is set to
// false then the root lines won't be visible
// even if the 'ShowRootLines' property is true.
// In that case just the expansion indicators
// will show.
this.ultraTree1.ShowRootLines =
true;
// Add a root node
UltraTreeNode node = this.ultraTree1.Nodes.Add("Node 1");
// Add some child nodes
UltraTreeNode childNode = node.Nodes.Add("child node 1");
childNode.Nodes.Add("child child 1");
childNode.Nodes.Add("child child 2");
childNode.Nodes.Add("child child 3");
// Add some grandchild nodes
childNode = node.Nodes.Add("child
node 2");
childNode = node.Nodes.Add("child node 3");
// Disable the node
childNode.Enabled = false;
childNode = node.Nodes.Add("child node 4");
// Add another root node
node = this.ultraTree1.Nodes.Add("Node 2");
// Activate the last child node added
this.ultraTree1.ActiveNode =
childNode;
// Bring the active node into view
this.ultraTree1.ActiveNode.BringIntoView();
} |
See Also