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.

Selecting item in ComboBoxAdv not working via C#.

Thread ID:

Created:

Updated:

Platform:

Replies:

121557 Dec 30,2015 02:35 PM Dec 31,2015 07:23 AM Windows Forms 2
loading
Tags: ComboBoxAdv
AlighaThor
Asked On December 30, 2015 02:35 PM

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.

AlighaThor
Replied On December 30, 2015 02:55 PM

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.

Senthil Kumaran Rajan [Syncfusion]
Replied On December 31, 2015 07:23 AM

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


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.

;