Version

AllowKeyboardSearch Property

Gets/sets a value which determines whether keyboard searches will be allowed.
Syntax
'Declaration
 
Public Property AllowKeyboardSearch As Boolean
public bool AllowKeyboardSearch {get; set;}
Remarks

When True and when the control is not in edit mode, pressing keyboard keys will automatically invoke a search of Visible, Expanded tree nodes. Keys entered in rapid succession will be assumed to be part of a word and so the control will search on all keys entered.

A short delay will clear the entered keys and start searching again from the first character entered.

This keyboard searching will always search on the Text property of the node.

The node matching the entered keys will be made the ActiveNode.

Note: In the case where the control is bound to a data source, the value of the NodeTextColumn property determines the data column from which the value of the Text property is obtained. If the NodeTextColumn property is not specifically set to the column which you want to provide the value of the node's Text property, the AllowKeyboardSearch property may not function as expected.

Example

The following sample code initializes various properties on an UltraWinTree control and illustrates how to populate the tree.



Imports Infragistics.Win.UltraWinTree

Private Sub InitializeTreeControl()

    With Me.ultraTree1
        ' Set various properties on the tree control

        ' Specify whether the tree will scroll during a 
        ' drag operation
        .AllowAutoDragScrolling = True

        ' Specify whether the tree will look for the
        ' next matching node as the user types.
        .AllowKeyboardSearch = True

        ' Specify the amount of milliseconds to wait
        ' before expanding a node during a drag
        ' operation.
        .AutoDragExpandDelay = 500

        ' Set the border style of the control
        .BorderStyle = Infragistics.Win.UIElementBorderStyle.InsetSoft

        ' Specify whether clicking anywhere on the 
        ' row the node is on will select the node.
        .FullRowSelect = False

        ' Specify whether selected nodes remain
        ' highlighted when the tree loses focus.
        .HideSelection = True

        ' Specify the padding around images in pixels.
        .ImagePadding = 3

        ' Specify how many pixels to indent each
        ' node level.
        .Indent = 8

        ' Specify the default size of images that will
        ' appear to the left and right of a node's text.
        .LeftImagesSize = New Size(12, 12)
        .RightImagesSize = New Size(8, 8)

        ' Specify the style and color os the node 
        ' connector lines.
        .NodeConnectorColor = Color.Red
        .NodeConnectorStyle = NodeConnectorStyle.Dotted

        ' Specify the string to be used to separate
        ' ancestor nodes when getting a node's
        ' 'FullPath' property. For example:
        'Me.ultraTree1..ActiveNode.FullPath
        .PathSeparator = "\"

        ' Specify whether scrollbars will be shown
        .Scrollable = Scrollbar.ShowIfNeeded

        ' Specify whether lines will appear between nodes
        .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.
        .ShowRootLines = True

        ' Add a root node
        Dim node As UltraTreeNode
        Dim childNode As UltraTreeNode

        node = .Nodes.Add("Node 1")

        ' Add some child nodes
        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 = .Nodes.Add("Node 2")

        ' Activate the last child node added
        .ActiveNode = childNode

        ' Bring the active node into view
        .ActiveNode.BringIntoView()

    End With

End Sub
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();

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also