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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl ComboBox Data Binding

Thread ID:





96742 Oct 4,2010 03:18 AM UTC Nov 22,2010 10:11 AM UTC WPF 1
Tags: GridControl
Elisha John
Asked On October 4, 2010 03:18 AM UTC


1. I created a griddatacontrol and data binded the itemsource and datacontext to an entityframeworkmodel like so:
private ExampleEntities context = new ExampleEntities();

this.ExampleGridDataControl.DataContext = this.context.Examples.ToList();

2. I then created a comboBox column like so:

3. And set the comboBox itemsSource:

StringCollection exampleList = new StringCollection();
this.ExampleGridDataControl.VisibleColumns[1].ColumnStyle.ItemsSource = exampleList;

4. When I load the gridDataControl, the comboBoxes cell values correspond to the actual values in the entityframework, however when I tried to change the values from the combo box, I get an error:
"Unable to cast object of type 'Syncfusion.Windows.Controls.Grid.HoverListBoxItem' to type 'System.String'.

Are there any specific ways I would need to dataBind the ComboBox column? It seems that there's an error converting the values back to the binding context. Please help.

Thank you

Kamalakannan A [Syncfusion]
Replied On November 22, 2010 10:11 AM UTC

Hi Elisha

Sorry for the delay caused.

We have created a sample and checked with your reported issue. We are able to reproduce the issue from our sample. Please create an new incident from the following link to get the updates and the fix for the issue.

Direct Trac: http://www.syncfusion.com/support/directtrac/dtnewpost

Sample reproduces the issue: CS - Copy161285244.zip

Please let us know if you need any details.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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