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

Keep selected item highlighted

4 Answers 222 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 25 Oct 2012, 11:16 PM
Hi,

I know that the default WPF combobox has the same behavior - but maybe RadCombobox can do it better.
What I want is a ComboBox where the user can select a single item from the dropdown.
This works so far - but when hovering an item with the mouse the user gets lost because the Selected Item is no longer highlighted.

Although I could create such a combobox with a togglebutton and a listbox in a popup I would prefer to use RadComboBox.

Is there a way to achieve this (easily)?

Thanks
Manfred

4 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 30 Oct 2012, 01:40 PM
Hi Manfred,

There isn't a built-in feature to enable the behavior you are trying to implement but any approach on achieving this behavior shouldn't differ between ComboBox and RadComboBox controls.

In RadComboBox this could be achieved by creating a class that inherits DataTemplateSelector and then set the ItemTemplateSelector of the control.

Hope this is helpful.

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
ManniAT
Top achievements
Rank 2
answered on 04 Nov 2012, 05:44 PM
Do you mean I have to provide three templates.
One for the  "top item" (in the collapsed combobox), one for the "normal items", and one for the selected item?

Is there an example showing this?
And will the template selector be called on hover?

Manfred
0
Accepted
Vladi
Telerik team
answered on 05 Nov 2012, 03:11 PM
Hi Manfred,

You should have two styles for the selected item and for the normal items. On the other hand we found an simpler approach on achieving the desired behavior and we create a sample project for you to take a look at. In the project all you need to do is set an ItemTemplate and bind to the IsSelected property of the RadComboBoxItem. It is worth mentioning that this is not the best practice on achieving the desired behavior but it is the simplest one we can provide.

If you have any followup questions feel free to write to us again.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
ManniAT
Top achievements
Rank 2
answered on 05 Nov 2012, 08:30 PM
Hi Vladi,

it's simple, it's working - and since I have about 10 items in my combobox no performance problems.
Thank you for the (as usual with telerik) fast and good support
Manfred
Tags
ComboBox
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Vladi
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or