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)
    paneGroup.Items.Add(rp);


  2. Answer
    Vladi
    Admin
    Vladi avatar
    744 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,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top