Flexible TreeView 5.1.9 Help
NodeComboBoxString node control

The NodeComboBoxString, in contrast to NodeComboBox and NodeComboBoxEnum, allows to bind to a string data property and select its value from the list of dropdown items.

It support the same features like NodeComboBox does, like DropDownItemsInteractiveDropDownItems and MaxDropDownItems, etc.

 

To bind NodeComboBoxString you need:

1) Define a string data property in a newly created or existing node class:

class CustomerNode : Node
{
  public string PreferedLanguage { get; set; }
}
Class CustomerNode
    Inherits Node
    Public Property PreferedLanguage() As String
        Get
            Return m_PreferedLanguage
        End Get
        Set
            m_PreferedLanguage = Value
        End Set
    End Property
    Private m_PreferedLanguage As String
End Class

2) Create a NodeComboBoxString instance, specify its dropdown list of available values to select and bind it to the added data property.

For testing purposes, below we create the node control manually in code, but it could be created in Visual Studio Windows Forms form's designer in design-time as well.

NodeComboBoxString ctrl = new NodeComboBoxString();
ctrl.DataFieldName = "PreferedLanguage";
ctrl.DropDownItems = new[] { "English", "Español", "Français", "Deutsch" };
ctrl.Editable = true;
ctrl.EditStartMode = eEditStartMode.Click; // optional
ctrl.AttachTo(tree);
Dim ctrl As New NodeComboBoxString()
ctrl.DataFieldName = "PreferedLanguage"
ctrl.DropDownItems = New () {"English", "Español", "Français", "Deutsch"}
ctrl.Editable = True
ctrl.EditStartMode = eEditStartMode.Click  ' optional
ctrl.AttachTo(tree)

After running above code and changing the appeared 'English' value by selecting new one from the dropdown, the PreferedLanguage property of the selected node class instance will be updated respectively.

 

 


Copyright © 2006-2016 ARMSoft

www.FlexibleTreeView.com