How to set raddock at a specific position inside the raddockzone

2 posts, 0 answers
  1. Gaurav
    Gaurav avatar
    4 posts
    Member since:
    Sep 2011

    Posted 21 Sep 2011 Link to this post


    I create raddock dynamically. I wish to add newly created raddock at  any position in the raddockzone.

    RadDockZone1.Controls.Add(dock) - adds dock at index 0 by default.

    Can you please suggest approach to add newly created raddock at any position in the raddockzone ?

  2. Slav
    Slav avatar
    1359 posts

    Posted 23 Sep 2011 Link to this post

    Hello Gaurav,

    Adding the RadDock dynamically to a selected position in the RadDockZone can be achieved by a client script, which is registered from the server and moves the dock to the desired position. Below you can find a code snippet, demonstrating how to register the suggested JavaScript function. Overall, it gets from a DropDownList the RadDockZone in which the RadDock should be docked and calls the client method dock.
        string.Format(@"function _moveDock() {{
                                Sys.Application.add_load(_moveDock);", dock.ClientID, DropDownZone.SelectedValue, dockPosition),

    The script, presented above, should be registered in the server-side event handler, used for dynamically creating a RadDock.

    For your convenience I have attached a sample project, implementing the suggested solution. Please use it as a reference for incorporating the desired functionality. 

    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