width of arrow-part in SplitButton

4 posts, 1 answers
  1. Ingemar
    Ingemar avatar
    18 posts
    Member since:
    Nov 2009

    Posted 22 Jul 2010 Link to this post

    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

  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 23 Jul 2010 Link to this post

    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
  3. DevCraft banner
  4. Ingemar
    Ingemar avatar
    18 posts
    Member since:
    Nov 2009

    Posted 23 Jul 2010 Link to this post

    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
  5. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 28 Jul 2010 Link to this post

    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
Back to Top