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
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
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}"
...
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
>
Regards,
Dinko
Progress Telerik
Thank you for your answer
It doesnt work(
Have you got any idea?
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