Display image on RadToolBarSplitButton other than image from dropdown item selected

3 posts, 0 answers
  1. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 03 Feb 2015 Link to this post

    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. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 04 Feb 2015 in reply to jlj30 Link to this post

    Hi,

    I found it!

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

        EnableDefaultButton="False"

    Jim
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 05 Feb 2015 Link to this post

    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.

     
Back to Top