SelectedItem not bindable + Pre-Selecting

Thread is closed for posting
2 posts, 0 answers
  1. schlabo
    schlabo avatar
    6 posts
    Member since:
    Jun 2012

    Posted 17 May 2015 Link to this post

    It seems that in the Universal UI variant of the Telerik UI (2015.1.420.45, currently working on the WinRT Windows Phone 8.1 part), "SelectedItem" can not be used for binding. Apparently, the property "SelectedItem" does not have an accessible setter. When searching for the control, it seems that other variants (e.g., WPF) of the control do allow binding to the SelectedItem.

    How to access the selected item via a binding from the ViewModel then, without writing some event-based code in the code behind file?

    The tasks I'd need to do is:

    1. Pre-set an item in the auto complete box (Two-Way binding) for the default value.

    2. Get the selected item out of the auto complete box when the user is finished with the data entry form on the page.

    My current workaround is to send the RadAutoCompleteBox as command parameter, to access its SelectedItem in the view model. But of course, it's not a good solution to work with the RadAutoCompleteBox control in the ViewModel. But switching to events and starting to use the code behind file isn't too much better. And for both workarounds, pre-selecting a value seems to be difficult.


  2. Tsvyatko
    Tsvyatko avatar
    863 posts

    Posted 20 May 2015 Link to this post

    Hi Andreas,

    Thank you for contacting us! Selected item represents the selected item from the autocomplete while the dropdown is active. In this scenario I can suggest using Text property instead as it represents the actual value that user has selected. 

    If the scenario cannot be achieved with the current API in MVVM we can consider opening the API to make it easier to use.

    Let me know if this makes sense.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top