How to show the multiple ComboBoxAdv with same datasource?
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
Figure 1: Displaying multiple ComboBoxAdv with same data source
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ComboBoxAdv_DataSource-85052616.zip
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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!