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.
Syncfusion Feedback

GDBGComboBox drop down bound to a dataset

Thread ID:

Created:

Updated:

Platform:

Replies:

59666 Apr 19,2007 02:32 PM UTC Apr 19,2007 04:55 PM UTC Windows Forms 2
loading
Tags: GridControl
Iain Holder
Asked On April 19, 2007 02:32 PM UTC

Hello

I have a GridDataBoundGrid bound to a dataset with two columns.

One of those columns is a ComboBox in drop down mode which is bound to a second data set containing the possible values which can be selected.

The problem is that when an item from the dropdown is selected, instead of the selected item being shown, I am instead getting

System.Data.DataRowView

How can I get it to show the selected value?

Please find an example sln attached.

GDBGComboBox_Iain.zip

Administrator [Syncfusion]
Replied On April 19, 2007 04:37 PM UTC

GridDataBoundGrid does not support 'dots' in the DisplayMember and ValueMembers on a combobox cell. It expects the DataSource to be a DataTable or DataView and the DisplayMember and ValueMember just to be the property name.

So, if you have this code in your form.Load, the problem goes away (making the DataSource be the Datatable and not the DataSet).

private void Form1_Load(object sender, System.EventArgs e)
{
PopulateDataSets();
this.gridBoundColumn3.StyleInfo.DataSource = this.iainTest1.WooRatings;
this.gridBoundColumn3.StyleInfo.DisplayMember = "WebsiteName";
this.gridBoundColumn3.StyleInfo.ValueMember = "WebsiteName";
}

Iain Holder
Replied On April 19, 2007 04:55 PM UTC

Great - thanks Clay.


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.

Warning Icon 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.Close Icon

;