How can I set DocumentHost in the code behind ?

2 posts, 0 answers
  1. Gilmar
    Gilmar avatar
    19 posts
    Member since:
    Jul 2010

    Posted 08 Mar 2013 Link to this post

    I would like to set DocumentHost in RadDocking in code behind, but always it is null. How can i fix it ?
  2. Georgi
    Georgi avatar
    344 posts

    Posted 13 Mar 2013 Link to this post

    Hello Gilmar,

    As the DocumentHost is an attached property it can be set as any attached property.
     For example a dock with DocumentHost set in code behind can be achieved as followed:
    RadDocumentPane docPane = new RadDocumentPane();
               docPane.Header = "Document Pane";
               RadDocumentPane notDragableDocPane = new RadDocumentPane();
               notDragableDocPane.CanFloat = false;
               notDragableDocPane.Header = "Not Dragable Document Pane";
               RadPaneGroup docGroup = new RadPaneGroup();
               RadSplitContainer docSplit = new RadSplitContainer();
               RadDocking dock = new RadDocking();
               dock.SetValue(RadDocking.DocumentHostProperty, docSplit);

    In the simple code the DocumentHost is set using dock.SetValue(RadDocking.DocumentHostProperty, docSplit);
    Hope this will help.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top