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

Selecting item in ComboBoxAdv not working via C#.

Hi. Here's the thing: I can't figure out how to display a value in ComboBoxAdv via C#. I'm populating the property DataSource with a List from one of my entities (I'm using EF6):

//My list:
var cardTypes = _cardTypeController.GetAllCardTypes().OrderBy(x => x.Type).ToList();

//Setting the DataSource.
cardTypeComboBox.DataSource = cardTypes;

//None of these worked:
cardTypeComboBox.Text = cardTypes[0].Type;
cardTypeComboBox.SelectedIndex = 0;
cardTypeComboBox.SelectedItem = cardTypes[0];

On running time I can select normally the items, but my default values does not show up, I'm getting the control text empty.
The funny thing is that on debugging I can see perfectly these properties and their expected values. What I doing wrong? Why I'm getting the control text empty?

Thanks.

2 Replies

AL AlighaThor December 30, 2015 07:55 PM UTC

Also I tested the old .Net ComboBox for curiosity. As I expected, it worked like a charm. In the docs it says: "ComboBoxAdv is an advanced combo box control that provides a similar object model as the framework of the ComboBox control". So....what's wrong?

Thanks.


SK Senthil Kumaran Rajan Syncfusion Team December 31, 2015 12:23 PM UTC

Hi AlighaThor,

 

Thanks for contacting Syncfusion Support.

 

We are unable to reproduce the reported behavior with ComboBoxAdv in normal cases. We have prepared a sample and video for your reference and it can be downloaded from here.

 

Sample : http://www.syncfusion.com/downloads/support/forum/121557/ze/ComboBoxList-2054875703

 

Video : http://www.syncfusion.com/downloads/support/forum/121557/ze/ComboBox226092192

 

Could you check with the above sample and let us know whether we have followed the same steps to reproduce the reported behavior? If not, please provide some additional details like Code Customization or sample that can reproduce the reported behavior? It will be helpful for us to analyze and provide you a prompt solution as early as possible.

 

Regards,

Senthil


Loader.
Live Chat Icon For mobile
Up arrow icon