BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
//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; } |
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