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

Button in RadToolbar and Style

2 Answers 233 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Patrick VADEL
Top achievements
Rank 1
Patrick VADEL asked on 11 Jun 2010, 02:53 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 15 Jun 2010, 01:08 PM
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.
0
Patrick VADEL
Top achievements
Rank 1
answered on 16 Jun 2010, 02:10 PM

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

Tags
ToolBar
Asked by
Patrick VADEL
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Patrick VADEL
Top achievements
Rank 1
Share this question
or