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

How to get the main RadPaneGroup (host)?

1 Answer 50 Views
Docking
This is a migrated thread and some comments may be shown as answers.
pavel
Top achievements
Rank 1
pavel asked on 17 Jul 2012, 06:19 PM
How to get the main RadPaneGroup (host)?
The following example is not possible to obtain the public RadPaneGroup (host). 

RadPane rp = new RadPane();
//rp.content = ......;
//......;
RadSplitContainer splitContainer = radDocking.DocumentHost as RadSplitContainer;
RadPaneGroup paneGroup = (splitContainer.Items as IEnumerable<RadPaneGroup>).FirstOrDefault(s => s.IsInDocumentHost == true);//(get error)
paneGroup.Items.Add(rp);


1 Answer, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 18 Jul 2012, 11:17 AM
 Hi Sergei,

To solve the problem you are having you should cast the splitContainer.Items to IEnumerable rather than to IEnumerable<RadPaneGroup>. The code snippet shows how to cast the splitContainer.Items to IEnumerable:

var paneGroup = (splitContainer.Items as IEnumerable).OfType<RadPaneGroup>().FirstOrDefault(s => s.IsInDocumentHost == true);

Hope this is helpful.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
pavel
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or