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

Custom Command

2 Answers 31 Views
Dock
This is a migrated thread and some comments may be shown as answers.
suvina paul
Top achievements
Rank 1
suvina paul asked on 25 May 2010, 07:33 AM
How to modify the image that appears as a custom command's icon. I tried the sample customdockcommand but it doesnt work for me, any other way of doing it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Pero
Telerik team
answered on 25 May 2010, 08:17 AM
Hi Suvina,

This can be easily achieved by setting a CssClass to the custom command, and then applying custom styling as shown in the sample code below:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .customCommand
        {
            background-image: url(img/customclose.png) !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </asp:ScriptManager>
    <div>
        <asp:Button ID="Button1" runat="server" Text="Set Height" OnClick="Button1_Click" />
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
            <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px">
                    <Commands>
                        <telerik:DockToggleCommand CssClass="customCommand" />
                    </Commands>
                    <ContentTemplate>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        CONTENT
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>
 

Regards,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
suvina paul
Top achievements
Rank 1
answered on 25 May 2010, 09:18 AM
Thanks a ton. This worked!!!!
Tags
Dock
Asked by
suvina paul
Top achievements
Rank 1
Answers by
Pero
Telerik team
suvina paul
Top achievements
Rank 1
Share this question
or