method Editors.Add (Key as Variant, Type as EditTypeEnum)
Adds a child editor and returns a reference to the newly created object.

   Key as Variant A string or long expression that indicates the key of the editor being added.  
   Type as EditTypeEnum An EditTypeEnum expression that indicates the type of the editor being added.  
  EditorAn Editor object being created.  
Use the Add method to add new type of editors to the control. Use the Editor property to assign an editor to a node. Use the EditType property to change the type of editor. Use the Option property to define options for a specific type of editor. Use the AddItem method to add new items to a drop down editor. Use the AddButton method to insert buttons to the editor. The control fires the ButtonClick event when user presses a button inside an editor. Use the Change event to notify your application that user alters the node's value or caption. 

Use the AutoEdit property to specify whether the control starts editing the focused node as soon as user moves the focused node. Use the Edit method to programmatically edit a node, if the AutoEdit property is False. 

If a node has an editor assigned the node's editor is applied to the:

The following sample adds a drop down editor and a float edit box:

With XMLGrid1
        .AutoEdit = True
        With .Editors.Add("Float", EditType)
            .Numeric = exFloat
        End With
        With .Editors.Add("DropDown", DropDownListType)
            .AddItem 1, "Yes"
            .AddItem 2, "No"
        End With
        With .Nodes
            With .Add("Root").Nodes
                With .Add("Child 1", "1.2")
                    .Editor = "Float"
                End With
                With .Add("Child 2", "1")
                    .Editor = "DropDown"
                End With
            End With
        End With
End With

Use the AddNode event to apply a specific editor to all nodes in the control at adding time.

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.