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

RadComboBox SelectedValue retaining value

1 Answer 187 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 07 Sep 2011, 06:13 AM
We have a specific requirement where a radcombox is defined with the following properties 
  • Allowcustomtext is true
  • EnableOnDemand is true
  • Items are loaded on ItemsRequested event
  • EnableViewstate and EnableItemcaching is false

As and when the user types in a text, the items are returned and by accessing the selectedvalue property I am able to retrieve the current selection.

But since custom text is allowed, user can type in any custom text and click insert. We cannot accept the user to insert custom values. When I check the text property of the radcombobox, its the custom text (adhoc value), but the selectedvalue retains the value of previously selected items value. I was expecting the selectedvalue to be null or empty string in case of an adhoc value.
On checking various telerik forums and google, suggestion to overcome this issue is use RadComboBox.Value property. But to my surprise, the 'value' property is not exposed. I tried using the SelectedItem.Value, but as rightly pointed out in Telerik troubleshooting SelectedItem will be null in case of LoadOnDemand.
Please suggest a way by which we can get to know whether the user has not entered any custom text (ad hoc).

Please note that the telerik radcombo is inside an user control, which is loaded as a pop-up.
I cannot set the allowcustomtext to false as I fetch items on item requested event.

Kindly suggest me a way to overcome this issue.

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 12 Sep 2011, 12:31 PM
Hello George,

When you are using load on demand then on the server you are able to obtain only the Text and SelectedValue of the RadComboBox. More information could be found in this help article here.

Please refer to the following help article in order to insure that an existing item has been selected.

Kind regards,
Dimitar Terziev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
George
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or