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

How To Know DocumentHost is Empty

1 Answer 18 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 08 Nov 2011, 10:34 PM
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,

KO

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivo
Telerik team
answered on 11 Nov 2011, 10:22 AM
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.

Regards,
Ivo
the Telerik team

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

Tags
Docking
Asked by
Kelly
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or