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. Image for the cookie policy date
close icon

GDBGComboBox drop down bound to a dataset

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

2 Replies

AD Administrator Syncfusion Team 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";
}


IH Iain Holder April 19, 2007 04:55 PM UTC

Great - thanks Clay.


Loader.
Live Chat Icon For mobile
Up arrow icon