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

Can't make Editable RadComboBox and Bindings work!

6 Answers 288 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
GVera
Top achievements
Rank 1
GVera asked on 29 Mar 2011, 05:02 PM
Hi,

I have a RadComboBox binded to objects in my ViewModel.  I have it as IsEdiatble = true since I want users to be able to add a new value if it does not exist in the drop down list.  So far, I can type the new value but I can't find a way on getting that new value input by the user.  Any help will be apreciated:

NOTE:  When the selected item changes I am using a Command propoerty from my ViewModel and it is working properly.

My Bindings:
MyObject = A Class with 2 properties (FieldName (String)  and TableName (String))
FieldList = Generic List<MyObject>
SlectedField = MyObject
ValueChanged = a command property (ICommand)

ItemsSource = {Binding FieldList} SelectedValuePath="FieldName" DisplayMemberPath="FieldName" SelectedItem={Binding SlectedField} Command={Binding ValueChanged}

Thanks.

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Apr 2011, 02:42 PM
Hello GVera,

RadComboBox doesn't allow to add new items like this. You can only enter text (when IsEditable is true) in order to search in the existing values.  We hope that this is not major show-stopper for you.

Greetings,
Yana
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
0
GVera
Top achievements
Rank 1
answered on 01 Apr 2011, 02:56 PM
Hi,

Thanks for the late response.  After some trying, I found a way to get the Editable TextBox through the visual tree of the RadComboBox element and set bindings to an object in my ViewModel.  I was able to then check the value and perform my operations.

Thanks again.
0
Yana
Telerik team
answered on 01 Apr 2011, 02:58 PM
Hello GVera,

I'm glad that you've managed to find a suitable way to implement the needed approach.

All the best,
Yana
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
0
Nicolo
Top achievements
Rank 1
answered on 02 Nov 2012, 09:27 AM
Hello GVera
I have the same scenario as you and have been searching around for a solution, but with no success. Could you or somebody from Telerik elaborate the solution?

Thanks in advance.
Nicolo
0
Yana
Telerik team
answered on 08 Nov 2012, 10:03 AM
Hello Nicolo,

There is really no easy way to achieve the desired behavior. The only workaround we can suggest is to use LostFocus event of RadComboBox, to get the entered text from Text property and add it to the collection which is bound to the ItemsSource of the ComboBox.

Hope this helps.

All the best,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Nicolo
Top achievements
Rank 1
answered on 08 Nov 2012, 10:51 AM
Hello Yana
Thanks for the response. Will try it.
Kind regards
Nicolo
Tags
ComboBox
Asked by
GVera
Top achievements
Rank 1
Answers by
Yana
Telerik team
GVera
Top achievements
Rank 1
Nicolo
Top achievements
Rank 1
Share this question
or