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.

ComboBoxBase and DataBindings

Thread ID:

Created:

Updated:

Platform:

Replies:

36683 Nov 7,2005 11:47 AM Nov 9,2005 04:19 PM Windows Forms 2
loading
Tags: Tools
Chad Elliot
Asked On November 7, 2005 11:47 AM

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

Anupama Roy [Syncfusion]
Replied On November 9, 2005 12:10 AM

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

Chad Elliot
Replied On November 9, 2005 04:19 PM

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

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.

;