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

Display image on RadToolBarSplitButton other than image from dropdown item selected

2 Answers 10 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
jlj30
Top achievements
Rank 2
jlj30 asked on 03 Feb 2015, 05:57 PM
Hi,

I am using the following RadToolBarSplitButton declaration:

<telerik:RadToolBarSplitButton runat="server" Value="textColor">
                        <Buttons>
                            <telerik:RadToolBarButton runat="server" Text="Black" Value="#text#000000" ImageUrl="Images/Navvia/standard_color_black_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="White" Value="#text#ffffff" ImageUrl="Images/Navvia/standard_color_white_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Dark Red" Value="#text#cc0000" ImageUrl="Images/Navvia/standard_color_dark_red_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Red" Value="#text#ff0000" ImageUrl="Images/Navvia/standard_color_red_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Orange" Value="#text#ffcc00" ImageUrl="Images/Navvia/standard_color_orange_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Yellow" Value="#text#ffff00" ImageUrl="Images/Navvia/standard_color_yellow_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Light Green" Value="#text#99cc66" ImageUrl="Images/Navvia/standard_color_light_green_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Green" Value="#text#009966" ImageUrl="Images/Navvia/standard_color_green_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Light Blue" Value="#text#0099ff" ImageUrl="Images/Navvia/standard_color_light_blue_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Blue" Value="#text#0066cc" ImageUrl="Images/Navvia/standard_color_blue_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Dark Blue" Value="#text#003366" ImageUrl="Images/Navvia/standard_color_dark_blue_16x16.png">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton runat="server" Text="Purple" Value="#text#663399" ImageUrl="Images/Navvia/standard_color_purple_16x16.png">
                            </telerik:RadToolBarButton>
                        </Buttons>
                    </telerik:RadToolBarSplitButton>

When I select an item from the dropdown, the corresponding image is placed in the splitbutton automatically.

I would like to place a "different" image in the splitbutton (not the one from the child item).

I have tried the following in the OnClientButtonClicked event handler, but it does nothing:

var toolBar = $find("<%=RadToolBar1.ClientID%>");
var textColorButton = toolBar.get_items().getItem(16);
textColorButton.set_imageUrl('Images/Navvia/text_color_16x16.png');

I know I have the right index (16), because when I bump it to 17 I see the desired image appear in the next toolbar button.

Any suggestions?

Thanks in advance.

Jim

2 Answers, 1 is accepted

Sort by
0
jlj30
Top achievements
Rank 2
answered on 04 Feb 2015, 02:00 PM
Hi,

I found it!

The solution was to add the following to my RadToolBarSplitButton declaration:

    EnableDefaultButton="False"

Jim
0
Nencho
Telerik team
answered on 05 Feb 2015, 08:46 AM
Hello jlj30,

Thank you for sharing your solution with the community.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ToolBar
Asked by
jlj30
Top achievements
Rank 2
Answers by
jlj30
Top achievements
Rank 2
Nencho
Telerik team
Share this question
or