We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show the multiple ComboBoxAdv with same datasource?

Platform: WinForms |
Control: ComboBoxAdv |
Published Date: March 2, 2015 |
Last Revised Date: May 22, 2019

You can use common data source with multiple 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: http://www.syncfusion.com/downloads/support/directtrac/general/ComboBoxAdv_DataSource-85052616.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon