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.
Unfortunately, activation email could not send to your email. Please try again.

How load ComboBoxAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

119796 Aug 2,2015 04:10 PM Aug 3,2015 11:59 PM Windows Forms 3
loading
Tags: ComboBoxAdv
Claudemiro Batista
Asked On August 2, 2015 04:10 PM

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.

Senthil Kumaran Rajan [Syncfusion]
Replied On August 3, 2015 05:45 AM

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

Claudemiro Batista
Replied On August 3, 2015 10:55 PM

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!!!

Kannan R [Syncfusion]
Replied On August 3, 2015 11:59 PM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;