Button in RadToolbar and Style

3 posts, 1 answers
  1. Patrick VADEL
    Patrick VADEL avatar
    9 posts
    Member since:
    Apr 2010

    Posted 11 Jun 2010 Link to this post

    Hello,

    I have a window with a RadToolbar and a button in this toolbar :

            <telerik:RadToolBar Height="32" HorizontalAlignment="Left" VerticalAlignment="Top" Width="388">  
                <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Name="button1">  
                    Test  
                </Button>  
            </telerik:RadToolBar>  
     

    All works fine, my button looks like a toolbar button (no border, no background).

    But if I put a style on my button (even if the style is empty) :

            <telerik:RadToolBar Height="32" HorizontalAlignment="Left" VerticalAlignment="Top" Width="388">  
                <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Name="button1">  
                    Test  
                    <Button.Style>  
                        <Style TargetType="Button">  
                        </Style>  
                    </Button.Style>  
                </Button>  
            </telerik:RadToolBar>  
     

    my button looks like a normal button (with border and background).

    Is there a workaround for this issue ?

    Thank you.

  2. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 15 Jun 2010 Link to this post

    Hello Patrick VADEL,

    When you do this - you are overriding the style that the Toolbar control is applying over the buttons. This is the reason for this behavior.

    What are you trying to implement? E.g. what style you want to apply to the button?

    Regards,
    Valentin.Stoychev
    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Patrick VADEL
    Patrick VADEL avatar
    9 posts
    Member since:
    Apr 2010

    Posted 16 Jun 2010 Link to this post

    Hello Valentin,

    I use style mainly to redefine the contenttemplate to put image in the content.

    For instance I create a saveStyle which have a save image in the content.

    But I use style to set margin, width, height and some stuff like that too.

    And with the standard toolbar the button's style don't change even if I set the style of the button.

    Nevertheless, with your explanation, now I just override the contenttemplate and all works like I expect.

    Thank you

    Regards

    Patrick Vadel

Back to Top