2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
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 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.
This page will automatically be redirected to the sign-in page in 10 seconds.