This is a migrated thread and some comments may be shown as answers.

How can I set DocumentHost in the code behind ?

1 Answer 206 Views
Docking
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gilmar
Top achievements
Rank 1
Gilmar asked on 08 Mar 2013, 05:44 PM
I would like to set DocumentHost in RadDocking in code behind, but always it is null. How can i fix it ?

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 13 Mar 2013, 12:25 PM
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();
           docGroup.Items.Add(docPane);
           docGroup.Items.Add(notDragableDocPane);
           docSplit.Items.Add(docGroup);
           RadDocking dock = new RadDocking();
           dock.SetValue(RadDocking.DocumentHostProperty, docSplit);
           LayoutRoot.Children.Add(dock);

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

Regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Gilmar
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or