CSS Sprites for RadToolBarButton in RadGrid CommandItemTemplate

2 posts, 0 answers
  1. Ali
    Ali avatar
    24 posts
    Member since:
    Apr 2010

    Posted 20 Jan 2013 Link to this post

    CSS Sprites for RadToolBarButton in RadGrid CommandItemTemplate

    I am using RadToolBarButton in RadGrid CommandItemTemplate. But I have over 15 buttons and each button has corresponding normal and hovered images. I want to use only one CSS sprites image for all the [image only] RadToolBarButtons to reduce http requests.

    <telerik:RadToolBarButton CommandName="InitInsert" ToolTip="Add Item"
        ImageUrl="~/Img/addN.png" HoveredImageUrl="~/Img/addH.png">

    <telerik:RadToolBarButton CommandName="EditSelected" ToolTip="Edit Item"
        ImageUrl="~/Img/editN.png" HoveredImageUrl="~/Img/editH.png">

    <telerik:RadToolBarButton CommandName="DeleteSelected" ToolTip="Delete Item"
        ImageUrl="~/Img/deleteN.png" HoveredImageUrl="~/Img/deleteH.png">
            <telerik:RadButton ID="BtnToggle" runat="server" ButtonType="ToggleButton" 
            ToggleType="CustomToggle" AutoPostBack="false" Checked="true" BackColor="White"
            ToolTip="Toogle Folders" OnClientClicked="jsToggleGroup">
                    <telerik:RadButtonToggleState Text="Collapse" Selected="true">
                    <telerik:RadButtonToggleState Text="Expand" >

    and so on ...

    What's the best way to do that? I noticed that RadToolBar has "EnableImageSprites" option. Does anyone have some sample code to enable sprites in RadToolBar?


    The team,
  2. Kate
    Kate avatar
    1898 posts

    Posted 23 Jan 2013 Link to this post


    A very similar approach that you can use as a base and further extend it as desired can be found in this help article - Using Sprite Images in RadToolBarSplitButton

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top