Hello,
I am using a RadComboBox with an ItemTemplate, bound to an ItemsSource (a GenericList of CLR objects) to make a sort of rich autocomplete combobox.
But when the user selects an item, the RadComboBox text field is filled with a ToString() result of the Objet that is selected.
The string displayed in the combobox after an item is selected is similar to: "Mynamespace.MyObject".
I tried setting the RadComboBox.Text property but that doesn't work. How can I bind the editable textfield to a property of the selected object? Or at least get something else than a ToString() result?
Edit:
Another weird thing is that when a user selects, for example, the 2nd item in the list, the SelectionChanged event is triggered 4 times with the following selected items:
- The selected item itself
- null
- The selected item itself
- The first item in the list
Edit 2:
If an item is selected and the user starts typing in the editable filed of the RadComboBox and you set the ItemsSource again, the editable field gets cleared.
Edit 3:
When using DisplayMemberPath, it works when using the defualt itemtemplate, but when I use a custom ItemTemplate, it doesn't seem to work.
To make things clear, this is what I am trying to achieve; I am trying to make a editable ComboBox that uses autocomplete via a WCF service. When a user fills in a part of the name, a WCF call is made and the ItemsSource is updated. When a user selects an Item, the name of the Item is filled in the ComboBox. When a user decides to change the field, the WCF call is made again, setting a new ItemsSource to the ComboBox. This may not overwrite the new searchstring the user has typed, like it does now.
Kind Regards,
Rob