Getting Started with Windows Forms ComboBox DropDown (ComboDropDown)
7 Jun 20212 minutes to read
In this section, ComboDropDown is used to host TreeView control and this can be achieved in the following ways.
This section will guide you to create a ComboDropDown control through designer and associate a TreeView control as its popup.
The below steps will guide you with this.
Create a new Visual C# application or VB.NET application in Visual Studio .NET.
Drag and drop a ComboDropDown control, TreeView control from the toolbox onto the form.
Add nodes to the TreeView control and set HideSelection property to false. The HideSelection property specifies whether the selected tree node remains highlighted even when the tree view has lost the focus.
Now set the ComboDropDown’s PopupControl property to be the above TreeView instance.
We can also include code to set up the interaction between the combo and the treeview control. Refer_ Setting Interaction between ComboDropDown and TreeView.
Drag and drop the TreeView control which will be used in the drop-down portion of ComboDropDown control.
- Include the required namespace.
- Create an instance of the ComboDropDown control class.
private Syncfusion.Windows.Forms.Tools.ComboDropDown comboDropDown1; this.comboDropDown1=new Syncfusion.Windows.Forms.Tools.ComboDropDown();
Private comboDropDown1 As Syncfusion.Windows.Forms.Tools.ComboDropDown Me.comboDropDown1 = New Syncfusion.Windows.Forms.Tools.ComboDropDown()
- Add TreeView in the drop-down portion of ComboDropDown. Finally add ComboDropDown to the Form.
Refer Setting Interaction between ComboDropDown and TreeView to set the interaction between the ComboDropDown and Treeview.