How To Know DocumentHost is Empty

2 posts, 1 answers
  1. Kelly
    Kelly avatar
    73 posts
    Member since:
    Apr 2011

    Posted 08 Nov 2011 Link to this post

    I have some RadRibbonContextualGroups in a RibbonView. I'd like to bind their IsActive props to something in a RadDocking that shares the same window. I'd like IsActive to be false when the Docking's DocumentHost is empty, and true if there is at least one pane in the DocumentHost. Can this be done through bindings?

    Thank you,

  2. Answer
    Ivo avatar
    390 posts

    Posted 11 Nov 2011 Link to this post

    Hi Kelly,

    The best way to achieve this is to cast the DocumentHost to RadSplitContainer, enumerate its panes and check if there are any panes that are not hidden. Here is sample code:
    bool hasVisiblePanes = ((RadSplitContainer)this.Dockings.DocumentHost).EnumeratePanes().Any(x => x.IsHidden == false);

    For the binding you can use a TypeConverter and use the code above.

    Hope this helps.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top