Articles in this section
Category / Section

How to show the multiple ComboBoxAdv with same datasource?

1 min read

You can use common data source with multiple WinForms ComboBoxAdv that are loaded in the same Parent form.

The following code example demonstrates the same.

C#

private List<string> GetList()
{
    //List collection.
    List<string> months = new List<string>();
    months.Add("Windows Forms");
    months.Add("WPF");
    months.Add("WindRT");
    months.Add("JavaScript");
    months.Add("Android");
    return months;
}
private void Monthlist(Syncfusion.Windows.Forms.Tools.ComboBoxAdv comboBoxAdv, List<string> list)
{
    //To get the data source.
    comboBoxAdv.DataSource = list;
}
//To assign data source to the ComboBoxAdv.
Monthlist(comboBoxAdv1,GetList());
Monthlist(comboBoxAdv2, GetList());
Monthlist(comboBoxAdv3, GetList());

VB

Private Function GetList() As List(Of String)
 'List collection.
 Dim months As New List(Of String)()
 months.Add("Windows Forms")
 months.Add("WPF")
 months.Add("WindRT")
 months.Add("JavaScript")
 months.Add("Android")
 Return months
End Function
Private Sub Monthlist(ByVal comboBoxAdv As Syncfusion.Windows.Forms.Tools.ComboBoxAdv, ByVal list As List(Of String))
 'To get the data source.
 comboBoxAdv.DataSource = list
End Sub
'To assign data source to the ComboBoxAdv.
Monthlist(comboBoxAdv1,GetList())
Monthlist(comboBoxAdv2, GetList())
Monthlist(comboBoxAdv3, GetList())

Screenshot

Showing multiple ComboBoxAdv with same data source

Figure 1: Displaying multiple ComboBoxAdv with same data source

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ComboBoxAdv_DataSource-85052616.zip

Conclusion

I hope you enjoyed learning about how to show the multiple ComboBoxAdv with same datasource.

You can refer to our WinForms ComboBoxAdv’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms ComboBoxAdv documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms ComboBoxAdv and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied