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

RadSplitButton with image as the content/background

2 Answers 129 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Keenan
Top achievements
Rank 1
Keenan asked on 08 May 2019, 04:26 PM

Hey,

I'm trying to change the RadSplitButton to have a background image similar to a ImageButton. Is this possible? If so, how?

Thanks

2 Answers, 1 is accepted

Sort by
0
Keenan
Top achievements
Rank 1
answered on 09 May 2019, 04:32 PM

I figured this out. Below is an example of a split button drop down with attached commands

<telerik:RadSplitButton Command="{Binding CreateCommand}">
    <StackPanel Orientation="Horizontal">
        <Image Source="add.png" />
    </StackPanel>
    <telerik:RadSplitButton.DropDownContent>
        <ListBox Name="DropDownContent">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <i:InvokeCommandAction Command="{Binding CreateCommand}" CommandParameter="{Binding ElementName=DropDownContent, Path=SelectedItem}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </ListBox>
    </telerik:RadSplitButton.DropDownContent>
</telerik:RadSplitButton>

 

I then populate the list box in the code behind

var listItem = new ListBoxItem {Content = "new item"};
DropDownContent.Items.Add(listItem);

 

Hopefully this helps someone.

0
Martin Ivanov
Telerik team
answered on 13 May 2019, 07:20 AM
Hello Keenan,

Thank you for sharing your solution.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Buttons
Asked by
Keenan
Top achievements
Rank 1
Answers by
Keenan
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or