ComboBoxBase and DataBindings

I am trying to bind a data set to a combo box which has a grid for the drop down list. I have created a GridListControl and then bound it to a ComboBoxBase. I added a databinding for the grid list control. When I run the program, the binding to the GridListControl appears to work because the correct row is highlighted, but the correct value is not displayed in the ComboBoxBase. I tried to bind the data set to the ComboBoxBase, but I could not figure out which property to bind to. Is it possible to accomplish this with the GridListContorl and the ComboBoxBase or do I need to use a different control? Thanks, Chad

2 Replies

AR Anupama Roy Syncfusion Team November 9, 2005 05:10 AM UTC

Hi Chad, Sorry for the delayed response. I have attached a sample that shows how to bind the data set to the ComboBoxBase with GridListControl as its drop-down. Hope this helps you. Please let me know if you have any questions. Thanks for your interest in Syncfusion products. Best Regards, Anu

ComboBoxBase_modified.zip


CE Chad Elliot November 9, 2005 09:19 PM UTC

Sorry, I don’t think I made myself clear enough in my initial post. Here is a sample scenario of what I am trying to accomplish using the Northwind database. I have a Products form, which shows one record from the Products table at a time. The form contains navigation buttons so the user can scroll through the records in the Products table. I have bound each control on the form to the data set that contains the data from the Products table. The code that I used to bind looks like this: txtProductID.DataBindings.Add("Text", MyDataSet.Tables("Products"), "ProductID") For the SupplierID field, I would like to have a combo box display the CompanyName from the Suppliers table instead of the SupplierID. I have created a ComboBoxBase which is bound to a GridListControl. The GridListControl shows all columns from the Suppleirs table. How do I bind the combo box to the Products table so when user navigates through the records in the Products tale, the correct CompanyName displays in the combo box? I have attached a sample so you can see what I have done so far. Thanks, Chad

ProductsDataBindingSample.zip

Loader.
Up arrow icon