How to get the main RadPaneGroup (host)?

2 posts, 1 answers
  1. pavel
    pavel avatar
    15 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2012 Link to this post

    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)

  2. Answer
    Vladi avatar
    749 posts

    Posted 18 Jul 2012 Link to this post

     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,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top