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

width of arrow-part in SplitButton

3 Answers 93 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Ingemar
Top achievements
Rank 1
Ingemar asked on 22 Jul 2010, 12:19 PM
Hi,

I want to achieve approx. the same look as in the latest demo for the splitbutton i.e. large content with a small arrow to the right. Can this be done in a simple way or do I have to adjust the control template? I cant see anything in the code for, lets say, x:Name=findButton.

Best regards,
//Ingemar

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 23 Jul 2010, 01:13 PM
Hi Ingemar,

The look of the RadSplitButton in the latest demo is the default look/style of the button. Therefore when you add a RadSplitButton in your application, you won't have to edit the ControlTemplate unless you need to change this default style.

Please find attached a sample project illustrating how to set the content and DropDownContent of the RadSplitButton both in XAML and in code-behind. Take a look at it and let me know if this is what you had in mind.

All the best,
Dimitrina
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
Ingemar
Top achievements
Rank 1
answered on 23 Jul 2010, 04:50 PM
Hi Dimitrina,

First I would like to say thanks for your sample code. Perfectly simple and I had no problem solving my issue after that. I should have backed up myself and started with  "Hello RadSplitButton", but I got fooled by what I consider to be a bug (or at least a very unexpected behavior). Implicit styles for RadToggleButton and RadButton affects RadSplitButton. Your code with added style shows this.

<Grid>
<Grid.Resources>
<Style TargetType="telerik:RadToggleButton">   <!--Affects the buttons!-->
<!--<Style TargetType="telerik:RadButton">-->  <!--Affects the buttons!-->
<!--<Style TargetType="telerik:RadRadioButton">-->    <!--OK! No effect-->
<!--<Style TargetType="telerik:RadDropDownButton">--> <!--OK! No effect-->
<!--<Style TargetType="telerik:RadSplitButton">-->    <!--OK! Affects the buttons!-->
<Setter Property="Margin" Value="5"/>
<Setter Property="Width" Value="100"/>
<Setter Property="Height"  Value="50"/>
</Style>
</Grid.Resources>
    <StackPanel Orientation="Horizontal">
        <telerik:RadSplitButton VerticalAlignment="Top" Margin="30" Width="120"HorizontalAlignment="Left" x:Name="findButton" />               
        <telerik:RadSplitButton VerticalAlignment="Top" Margin="30" Width="120"HorizontalAlignment="Left">
            <telerik:RadSplitButton.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Text" VerticalAlignment="Center" Margin="2,2,3,2" />
                </StackPanel>
            </telerik:RadSplitButton.Content>
            <telerik:RadSplitButton.DropDownContent>
                <ListBox>
                    <ListBoxItem Content="Item 1" />
                    <ListBoxItem Content="Item 2" />
                    <ListBoxItem Content="Item 3" />
                    <ListBoxItem Content="Item 4" />
                </ListBox>
            </telerik:RadSplitButton.DropDownContent>
        </telerik:RadSplitButton>
    </StackPanel>
</Grid>

Best regards,
//Ingemar
0
Accepted
Dimitrina
Telerik team
answered on 28 Jul 2010, 02:13 PM
Hi Ingemar,

I see your point. However, since the RadSplitButton is a UI combination of the RadButton and the RadDropDownButton this behavior is expected. Therefore it is best to set keys to the RadButtonStyle and RadDropDownButtonStyle and implicitly define where you need to apply them.

Let us know if you need more info.

Kind regards,
Dimitrina
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
Tags
Buttons
Asked by
Ingemar
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Ingemar
Top achievements
Rank 1
Share this question
or