RadComboBox SelectedValue retaining value

2 posts, 0 answers
  1. George
    George avatar
    9 posts
    Member since:
    Apr 2011

    Posted 07 Sep 2011 Link to this post

    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.
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 12 Sep 2011 Link to this post

    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
Back to Top