Infragistics2.Win.UltraWinTree.v8.1
LabelEdit Property
See Also  Example
Infragistics.Win.UltraWinTree Namespace > Override Class : LabelEdit Property

Gets/sets a value indicating whether the text of a UltraTreeNode can be edited by the user.

Syntax

Visual Basic (Declaration) 
Public Property LabelEdit As DefaultableBoolean
C# 
public DefaultableBoolean LabelEdit {get; set;}

Remarks

When LabelEdit resolves to true, clicking (or pressing F2) on the UltraTree.ActiveNode will automatically put the UltraTreeNode into LabelEdit mode.

When LabelEdit resolves to false, LabelEdit mode cannot be entered by user interaction.

To validate data entered into a node, use the UltraTree.ValidateLabelEdit event.

Note: The UltraTreeNode.BeginEdit method can be used to programmatically place an UltraTreeNode into LabelEdit mode. In this case, the value of the LabelEdit property is not applicable.

Note: If the UltraTreeNode is bound to a data source, the LabelEdit property is not applicable unless the Override.UseEditor property resolves to true.

Example

The following sample code illustrates how to set some node behavior options.

Visual BasicCopy Code
    Imports Infragistics.Win
    Imports Infragistics.Win.UltraWinTree

    Private Sub button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button7.Click

        ' Note: the Override objects are exposed as properties off
        ' the tree, the node and the nodes collection as well as
        ' items in the NodeLevelOverrides collection. This allows
        ' default settings to be specified for the tree, a node,
        ' a node's children or for a level in the tree.

        ' Use the tree's Override property to
        ' set the default for all nodes.
        Me.ultraTree1.Override.LabelEdit = DefaultableBoolean.True
        Me.ultraTree1.Override.NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansion

        ' Set the default for nodes that are at level 2
        ' (i.e. grandchild nodes of root modes).
        ' This overrides the default setting above.
        Me.ultraTree1.NodeLevelOverrides(2).LabelEdit = DefaultableBoolean.False
        Me.ultraTree1.NodeLevelOverrides(2).NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansionWhenExpansionIndicatorVisible

        ' Set the default for nodes at the root level.
        ' This overrides the default settings above.
        Me.ultraTree1.Nodes.Override.LabelEdit = DefaultableBoolean.True
        Me.ultraTree1.Nodes.Override.NodeDoubleClickAction = NodeDoubleClickAction.None

        Dim node As UltraTreeNode

        ' Get a specific node by its key value.
        ' Note: this will return the node that has that key
        ' from anywhere in the tree structure since keys are
        ' unique across the entire tree.
        node = Me.ultraTree1.GetNodeByKey("child node 1")

        ' Set the property for that specific node only.
        ' This overrides any default settings above.
        node.Override.LabelEdit = DefaultableBoolean.True
        node.Override.NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansionWhenExpansionIndicatorVisible

        ' Set the property for that specific node's child nodes
        node.Nodes.Override.LabelEdit = DefaultableBoolean.True
        node.Nodes.Override.NodeDoubleClickAction = NodeDoubleClickAction.None

    End Sub
C#Copy Code
       using Infragistics.Win;
       
using Infragistics.Win.UltraWinTree;

       
private void button7_Click(object sender, System.EventArgs e)
       {

           
// Note: the Override objects are exposed as properties off
           
// the tree, the node and the nodes collection as well as
           
// items in the NodeLevelOverrides collection. This allows
           
// default settings to be specified for the tree, a node,
           
// a node's children or for a level in the tree.

           
// Use the tree's Override property to
           
// set the default for all nodes.
           
this.ultraTree1.Override.LabelEdit = DefaultableBoolean.True;
           
this.ultraTree1.Override.NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansion;
       
           
// Set the default for nodes that are at level 2
           
// (i.e. grandchild nodes of root modes).
           
// This overrides the default setting above.
           
this.ultraTree1.NodeLevelOverrides[2].LabelEdit = DefaultableBoolean.False;
           
this.ultraTree1.NodeLevelOverrides[2].NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansionWhenExpansionIndicatorVisible;

           
// Set the default for nodes at the root level.
           
// This overrides the default settings above.
           
this.ultraTree1.Nodes.Override.LabelEdit = DefaultableBoolean.True;
           
this.ultraTree1.Nodes.Override.NodeDoubleClickAction = NodeDoubleClickAction.None;

           
// Get a specific node by its key value.
           
// Note: this will return the node that has that key
           
// from anywhere in the tree structure since keys are
           
// unique across the entire tree.
           
UltraTreeNode node = this.ultraTree1.GetNodeByKey("child node 1");

           
// Set the property for that specific node only.
           
// This overrides any default settings above.
           
node.Override.LabelEdit = DefaultableBoolean.True;
           node.Override.NodeDoubleClickAction = NodeDoubleClickAction.ToggleExpansionWhenExpansionIndicatorVisible;

           
// Set the property for that specific node's child nodes
           
node.Nodes.Override.LabelEdit = DefaultableBoolean.True;
           node.Nodes.Override.NodeDoubleClickAction = NodeDoubleClickAction.None;

       }

See Also