IsMouseOver Trigger does not override Background Property

2 posts, 0 answers
  1. Steven
    Steven avatar
    35 posts
    Member since:
    Apr 2011

    Posted 09 Dec 2011 Link to this post


    Why my Trigger on the property IsMouseOver does not display a Red Background ?

    <Style TargetType="telerik:RadButton">
               <Trigger Property="IsMouseOver" Value="true">
                   <Setter Property="Background" Value="Red"/>

    Should I override it ?
    I am using the metro theme.

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 12 Dec 2011 Link to this post

    Hello Steven,

    The default ControlTemplate of the RadButton control defines a trigger that sets the background of the control while the mouse is over it. And since the ControlTemplate trigger is applied after the Style trigger you defined, the Red color isn't applied.

    This is why if you need to change the default MouseOver background, you'll have to edit the ControlTemplate of the RadButton - you can find the ControlTemplate structure of the control here and you can follow this approach to change it.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top