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

RadComboBoxItem - When to use chrome control and when not to?

1 Answer 49 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 26 Oct 2010, 01:37 PM
I was working with a RadComboBoxItem this morning and was puzzled to see that the only VSM states were 'Normal', 'MouseOver', and "Disabled'...  After a few minutes I discovered the 'IsSelected' property and bound the 'ButtonChrome.RenderSelected' property to it and things seemed to work fine.   The ButtonChrome control also has a RenderHighlighted property so I tried binding the IsHighlighted property to that and it also seemed to work....

So my two questions are:
1) Why not just bind the 'RenderHighlighted' property as well instead of using the VSM to switch it?  (Or reasons why this shouldn't be done)?
2) Any particular reason the VSM doesn't have a "SelectionStates" group like the normal Silverilght ComboBox?

Thanks,
Rob

1 Answer, 1 is accepted

Sort by
0
Accepted
Pana
Telerik team
answered on 29 Oct 2010, 01:29 PM
Hi Rob,

The ChangeVisualState() of the RadComboBoxItem currently looks like this:

private void ChangeVisualState(bool useTransitions)
{
    if (this.IsEnabled)
    {
        if (this.IsHighlighted)
        {
            this.GoToState(useTransitions, "MouseOver");
        }
        else
        {
            this.GoToState(useTransitions, "Normal");
        }
    }
    else
    {
        this.GoToState(useTransitions, "Disabled");
    }
}

So it only has 3 states  - Disabled, Normal and MouseOver. It will render the selected item as "MouseOver"-ed until you mouse over another element. It will also move the "MouseOver" using tab navigation this has been so for long time and is

I am glad you have figured out the ButtonChrome yourself. It is quite powerful tool if you are writing XAML by hand or doing a lot of custom templates as you can style one ButtonChrome and then drop chromes around and TemplateBinding them for IsMouseOver/IsSelected/IsHighlighted etc. and if you change the chrome's style all controls will pick the change from it.

All the best,
Panayot
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
Tags
ComboBox
Asked by
Rob
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or