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

Change RadDropDownButton's disabled style

5 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Valeriy
Top achievements
Rank 1
Valeriy asked on 19 Oct 2017, 05:30 PM

Hi!

I need to change RadDropDownButton's disabled style.

Code:

<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadDropDownButton">
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground"  Value="Red" />
                        </Trigger>

Foreground changes it style.  But it is something like watermark.

How can I remove it? And increase it's contrast.

Thanks in advance

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 24 Oct 2017, 07:12 AM
Hi Valeriy,

Thank you for contacting us.

A possible approach to achieve this is to extract the ControlTemplate of the button and find the VisualState element with its set to "Disabled". You can navigate to a Border with  DisabledVisual and change its appearance.

You can take a look at the Editing Control Templates help article in our documentation which describes how you can extract the default template of the controls.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Valeriy
Top achievements
Rank 1
answered on 24 Oct 2017, 05:14 PM

Yes, it also changes. But which property of the border can change style?

It is still not so contrast. Lokks like transparent watermark on control.

...

<Border x:Name="DisabledVisual"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"

...

 

0
Dinko | Tech Support Engineer
Telerik team
answered on 27 Oct 2017, 08:47 AM
Hello Valeriy,

Another approach is to change the opacity in the VisualState with "Disabled" which TargetName is Content and DropDownIndicator.
<VisualState x:Name="Disabled">
    <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledVisual">
            <DiscreteObjectKeyFrame KeyTime="0">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Visible</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content"/>
        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DropDownIndicator"/>
    </Storyboard>
</VisualState>
In your case, I am not sure which theme are you using. The code is extracted from Office_Black theme. Give this approach a try and let me know if it works for you.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Valeriy
Top achievements
Rank 1
answered on 27 Oct 2017, 10:46 AM

Thank you for your answer

It doesnt work(

Have you got any idea?

0
Dinko | Tech Support Engineer
Telerik team
answered on 01 Nov 2017, 10:29 AM
Hi Valeriy,

I am not sure that I have understood what is not working from your last reply. Can you elaborate more on your approach? You can send me pictures of the final behavior which you are trying to achieve. Also, which theme are you referencing in your project?

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
General Discussions
Asked by
Valeriy
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Valeriy
Top achievements
Rank 1
Share this question
or