Dock Position/Index in DockZone

2 posts, 1 answers
  1. Siva Kumar
    Siva Kumar avatar
    1 posts
    Member since:
    Jun 2009

    Posted 25 Jan 2010 Link to this post


    I'm trying to add Dock's to a DockZone dynamically. No problem with that. Docks get added to DockZone, but I want to insert a doc to a particular position (between 2 docks); which Im having problems with.

    This is what Im trying to do:
    a. RadDockZone CurrDocZone = (RadDockZone)FindControl(DocZoneToAdd);

    Always adds to the start of the doczone.

    b. Tried,
    RadDockZone CurrDocZone = (RadDockZone)FindControl(DocZoneToAdd);
    CurrDocZone.Docks.Insert(Position, dock);    
    CurrDocZone.Controls.AddAt(Position, dock);               

    But it throws exception that, A control with ID '<some unique Dock ID>' could not be found for the trigger in UpdatePanel 'UpdatePanel2'.

    Can you pls. let me know what could be wrong in there... Pls. let me know if you need more info.


  2. Answer
    Pero avatar
    1156 posts

    Posted 26 Jan 2010 Link to this post

    Hi Siva,

    For the time being there is no server side method (or property) that will add the dock at the desired position (index) in the zone. This can be done with client-script rendered from the server. The following source code registers the script.
    int dockPosition = Convert.ToInt32(ddlPosition.SelectedValue);
    //Register a script to move dock to the last place in the RadDockZone
    //The zone.dock(dock,index) client-side method is used
    string.Format(@"function _moveDock() {{
                        Sys.Application.add_load(_moveDock);", dock.ClientID, DropDownZone.SelectedValue, dockPosition),

    For your convenience I have attached the sample project that I tested.

    Please do not hesitate to contact us, if you have any further questions.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top