RadDock position in RadDockZone

5 posts, 0 answers
  1. madhu
    madhu avatar
    29 posts
    Member since:
    Mar 2007

    Posted 07 Jun 2007 Link to this post

    Hi
    I am creating dynamic RadDocks when a panelbar Items are clicked.
    I am creating all of them in the same Zone.
    When new one is created I want the new RadDock to be created at the starting position of the zone.
    I mean the new RadDock should be at position 1 in RadDockZone.
    How to set the position of RadDock at the creation time itself within in the RadDockZone?
    Can I get solution for this.
    Thank you.
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Jun 2007 Link to this post

    Hello madhu,

    If you are using code like this to add your RadDock controls:
    ScriptManager.RegisterStartupScript(
      dock,
      this.GetType(),
      "AddDock",
      string.Format(@"function _addDock() {{" +
       "Sys.Application.remove_load(_addDock);" +
       "$find('{1}').dock($find('{0}'));" +
       "$find('{0}').doPostBack('DockPositionChanged');" +
       "}};" +
       "Sys.Application.add_load(_addDock);", dock.ClientID, ZoneLeft.ClientID),
      true);


    You need to modify the following line to accomplish your requirement:
       "$find('{1}').dock($find('{0}', 0));" +

    0 is the zero based index, where the new dock should be docked.

    Sincerely yours,
    Valeri Hristov (Senior Developer, MCSD)
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Chris
    Chris avatar
    171 posts
    Member since:
    Oct 2006

    Posted 06 Aug 2007 Link to this post

    Hi,

    I modified my code as you stated from your code.  

       "$find('{1}').dock($find('{0}', 0));" +


    But I still don't get the new dock to come up at the first position from the dockzone.  It always added to the end.  Any idea why? or any other places I need to change/update?
  4. madhu
    madhu avatar
    29 posts
    Member since:
    Mar 2007

    Posted 06 Aug 2007 Link to this post

    Hi Chris

    It should be
      "$find('{1}').dock($find('{0}'), 0);" +
    This should work
    Check it.

  5. Chris
    Chris avatar
    171 posts
    Member since:
    Oct 2006

    Posted 06 Aug 2007 Link to this post

    My careless mistake. Thanks Madhu, it works!  =)
Back to Top