Dock creation

7 posts, 0 answers
  1. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Jul 2007 Link to this post

    I am testing one of your example and I don't remember were I got it from so I am posting a new thread.  in the example you add the dock to a zone when it is added to the page with the following line of code ScriptManager.RegisterStartupScript(dock, Me.[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)

    How can I add the dock to the page with adding it directly to a zone?

    Thanks
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 18 Jul 2007 Link to this post

    Hi rebtech,

    You can use the following approach:

    RadDockZone1.Controls.Add(dock)

    where RadDockZone1 is the ID of a zone and dock is a RadDock object.
    Hope this helps.

    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 18 Jul 2007 Link to this post

    I'm sorry I meant to ask (How can I add the dock to the page

    without

    adding it directly to a zone?) because in the example you are adding ti the 1st zone.

    thanks

  5. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 18 Jul 2007 Link to this post

    I'm sorry I meant to ask (How can I add the dock to the page

    without

    adding it directly to a zone?) because in the example you are adding ti the 1st zone.

    thanks

  6. Petya
    Admin
    Petya avatar
    869 posts

    Posted 18 Jul 2007 Link to this post

    Hi rebtech,

    In this case, just add the docks to the RadDockLayout:

    RadDockLayout1.Controls.Add(dock)

    Let me know if you have more troubles.

    All the best,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 18 Jul 2007 Link to this post

    that doesn't work because it's being created through an updatepanel using ajax, but I found the orignal thread I got it from.

    thanks for your help
  8. Petya
    Admin
    Petya avatar
    869 posts

    Posted 18 Jul 2007 Link to this post

    Hello rebtech,

    I believe this issue is discussed in this thread. I am pasting the answer again here as we try to keep the other thread as clean as possible and your question is not closely related to the PortalSite example but more to a general work with the control:

    "In Valeri's example the docks are first added to a hidden update panel and then moved to a zone. To add the dock to the page without adding it to a zone one option is to simply add the dock to the update panel

    UpdatePanel1.ContentTemplateContainer.Controls.Add(dock);

    but you need to make the panel visible.

    The other possibility is to directly add them the RadDockLayout as I explained in this thread without using the hidden update panel at all. I am attaching a simple page demonstrating this possibility. Please, note that my page is just an example and there is no preservation of state or recreation of the objects - it merely adds dynamically a dock to the page."



    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017