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

CSS Sprites for RadToolBarButton in RadGrid CommandItemTemplate

1 Answer 101 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 20 Jan 2013, 07:24 AM
CSS Sprites for RadToolBarButton in RadGrid CommandItemTemplate

Hi,
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>

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

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

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?

Thanks.

The team,
http://www.megasearches.com/

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 23 Jan 2013, 09:55 AM
Hello,

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,
Kate
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.
Tags
ToolBar
Asked by
Ali
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or