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. Image for the cookie policy date
close icon

How load ComboBoxAdv

Hi!

I would like to know how can I to load the control ComboBoxAdv. This control is similar ComboBox from C# .NET? Please, show me a sample of how to load this control programmatically.



Thanks.

3 Replies

SK Senthil Kumaran Rajan Syncfusion Team August 3, 2015 09:45 AM UTC

Hi Claudemiro,

Thank you for using Syncfusion products.

Yes, ComboBoxAdv control is similar to ComboBox from C# .NET. Please refer the below code snippet to load the ComboBoxAdv control programmatically.

Code Snippet[C#]:

//To initialize ComboBoxAdv

   ComboBoxAdv comboboxadv = new ComboBoxAdv();

   ComboBoxAdv ComboBoxDataBinding = new ComboBoxAdv();

  private void Form1_Load(object sender, EventArgs e)

  {

    //To add the ComboBoxAdv control into the GroupBox.       

    this.groupBox1.Controls.Add(comboboxadv);

    this.groupBox2.Controls.Add(ComboBoxDataBinding);


       //To set location of ComboBoxAdv

       this.comboboxadv.Location = new System.Drawing.Point(60, 80);

       //To set size of ComboBoxAdv

       this.comboboxadv.Size = new System.Drawing.Size(121, 21);

       //To add items in comboboxadv

       this.comboboxadv.Items.AddRange(new object[] {

            "Item1",

            "Item2",

            "Item3",

            "Item4",

            "Item5"});


       //To set style for ComboBoxAdv

       this.comboboxadv.Style = VisualStyle.Metro;

       this.ComboBoxDataBinding.Style = VisualStyle.Metro;


       //To set location of ComboBoxAdv

       this.ComboBoxDataBinding.Location = new System.Drawing.Point(200, 80);

       //To set size of ComboBoxAdv

       this.ComboBoxDataBinding.Size = new System.Drawing.Size(121, 21);

       // Create a DataTable.   

       DataTable dt = new DataTable("Table1"); 

       // Adding Columns.

       dt.Columns.Add("FirstName");

       dt.Columns.Add("LastName");

       dt.Columns.Add("occupation");

       dt.Columns.Add("place");



         // Create a Data Set.

         DataSet ds = new DataSet();

         ds.Tables.Add(dt);

         dt.Rows.Add(new string[] { "John", "Tina", "Doctor", "Italy" });

         dt.Rows.Add(new string[] { "Mary", "anu", "Teacher", "America" });

         dt.Rows.Add(new string[] { "asha", "roy", "Staff", "London" });

         dt.Rows.Add(new string[] { "George", "Gaskin", "Nurse", "germany" });

         dt.Rows.Add(new string[] { "sam", "jens", "Engineer", "Russia" });

         dt.Rows.Add(new string[] { "Ben", "Geo", "Developer", "India" }); 

         // Create a DataView.

         DataView view = new DataView(dt); 

        // To Bind datasource with ComboBoxAdv.

        this.ComboBoxDataBinding.DataSource = view; 

        // Set DisplayMember.

         this.ComboBoxDataBinding.DisplayMember = "place";


    //To set style for the ComboBoxAdv.

    this.comboboxadv.Style = VisualStyle.Metro;

    this.ComboBoxDataBinding.Style = VisualStyle.Metro;

     }


We have prepared the sample for your reference and it can be downloaded from the below location.

Sample Location : http://www.syncfusion.com/downloads/support/directtrac/142201/ze/LoadComboBoxAdv-569672496

Please let us know if you need further assistance.

Regards,
Senthil


CB Claudemiro Batista August 4, 2015 02:55 AM UTC

Great!

I really like very much of the sample and about the control, too!!!
I'll need more help, but about another control. So I have to open a new thread.

Thank you very much!!!


KR Kannan R Syncfusion Team August 4, 2015 03:59 AM UTC

Hi Claudemiro,

Thank you for your valuable feedback.

We are glad to know that, your requirement has been achieved. Please let us know if you need any further assistance, we will be happy to assist you.

Regards,

Kannan


Loader.
Live Chat Icon For mobile
Up arrow icon