FindByKey Method

Searches for and returns the specified node object in the TreeView control.

App.ActiveForm.TreeViewObject.Nodes.FindByKey(Key)

Client support

   Newlook Smartclient only.

Use

You can use this method to return an object reference that can be used with the EnsureVisible method. This method is useful for maintaining references to Nodes from other controls or data. For example the key value of the Node could be stored within the ItemData array of a ListBox control so that it may be latter be used to locate an associated Node in a given TreeView.

Arguments

Key - (String, Required)

A string which uniquely identifies a Node in the Nodes collection. This string can be optionally assigned to a node when created using the Add method.

Returns

The FindByKey method returns the Node object that has the same Key property as that specified. If the node is not found the return value will be null.

EXAMPLES

The following example will store the node with the same key as that specified in the variable vNodeKey.

J SCRIPT

function GetNode()

{

//Save the specified node in a global Newlook variable.

vSavedNode = App.ActiveForm.tvOrgChart.Nodes.FindByKey(vNodeKey);

App.SetValue("SavedNode", vSavedNode);

App.SetValue("SavedNodeText", vSavedNode.Text)

}

Applies To

Nodes collection

See Also

 TreeView control | Node object | LastClickedNode property | GetFirstVisible method


© 2004-2021 looksoftware. All rights reserved.