This is a migrated thread and some comments may be shown as answers.

RadComboBox SelectedItem is null where there is only one item in the list.

1 Answer 79 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 26 Jan 2017, 01:05 PM

Hi,

I have discovered an issue where the SelectedItem for a RadComboBox is null.

I use a System.Collections.Generic.IList to populate the RadComboBox.

When the IList has more than one item, then the RadComboBox works fine, and I can get the SelectedItem.

When the IList only has one item, then the RadComboBox has a SelectedItem of null.

Please see the attached to see how I populate the RadComboBox

Kinds regards,

Rob

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 31 Jan 2017, 11:17 AM
Hello Rob,

I attached a sample runnable page that has a ComboBox bound to a List. At my end it works as expected and the SelectedItem property correctly returns the selected item regardless of the list containing multiple or a single item. I am not sure which event handler you are trying to access SelectedItem in, so the example shows how the selected item can be accessed in an asp:Button's click handler. Could you modify the page so it reproduces the problematic behavior and post your modifications for further review?

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ComboBox
Asked by
Rob
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or