Replace custom command image when it it clicked

2 posts, 0 answers
  1. prayag ganoje
    prayag ganoje avatar
    127 posts
    Member since:
    Feb 2010

    Posted 13 May 2011 Link to this post


    I have a raddock with custom commands. I wish to replace custom command icon with a loading gif image when that icon is clicked till the time dock get refreshed completely. Then get back to original icon.

    Can you please suggest how to do that ?
  2. Pero
    Pero avatar
    1156 posts

    Posted 13 May 2011 Link to this post

    Hi Prayag,

    I suppose the RadDock is refreshed only during ajax requests, and that's why I would recommend using the PageRequestManager's endRequest client-side event. Please modify the client script in the project attached to the following forum post, as shown below: Forum Post.

    <script language="javascript" type="text/javascript">
        function Click(dockId)
            var dock = $find(dockId);
            var customCommand = dock.get_commands()["CustomCommand"];
            var commandElement = customCommand.get_element().firstChild;
            if (commandElement)
                Sys.UI.DomElement.addCssClass(commandElement, "rdCustom1Loading");
                function EndRequest()
                    window.setTimeout(function ()
                        if (commandElement)
                            Sys.UI.DomElement.removeCssClass(commandElement, "rdCustom1Loading");
                    }, 1000);
                    var requestManager = Sys.WebForms.PageRequestManager.getInstance();
                    if (requestManager)
                var requestManager = Sys.WebForms.PageRequestManager.getInstance();
                if (requestManager)

    Best wishes,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top