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

Showing and hiding RadPanes conditionally

4 Answers 321 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 2
Erwin asked on 25 Jul 2011, 03:05 PM
Hi,

I have two radpanes in one radpanegroup, each with a chart. I want to show one of these two (and only one), based upon some conditions.
I have made a  property for Visibility and two  'Boolean' properties, one holding true or false and the other holding false or true.
With these properties I set the radpane properties like Visibility, IsHidden, IsEnabled, IsSelected for both radpanes.
However, this does not toggle shown radpanes / charts. (actually, it does, but I have to click on the radpane tab to get it shown....)
I've tries a lot of different combinations, but I haven't succeeded so far.

Can anybody tell me how to do this?

This is how the two radpanes in XAML look like:

                    <telerik:RadPaneGroup x:Name="graph1RadPaneGroup">                 
                        <telerik:RadPane x:Name="multiOrderLineRadPane" 
                                         Header="[Problem Orders By Supplier]" 
                                         Visibility="{Binding OrderCountBySupplierGraphVisibility}" 
                                         IsPinned="True"
                                         IsSelected="{Binding  IsMultiOrderItemsSelected}" 
                                         IsEnabled="{Binding IsMultiOrderItemsSelected}" 
                                         CanUserClose="False">
                            <views:OrderCountBySupplierGraphView/>
                        </telerik:RadPane>
                        <telerik:RadPane x:Name="singleOrderLineRadPane"  
                                         Header="[Graph 1a]" 
                                         Visibility="{Binding SingleItemOrderCountGraphVisibility}"                                          
                                         IsPinned="True"                                       
                                         IsSelected="{Binding IsSingleOrderItemSelected}" 
                                         IsEnabled="{Binding IsSingleOrderItemSelected}" 
                                         CanUserClose="False">
                            <views:SingleItemOrderCountGraphView/>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>

Looking forward to replies,

Erwin


4 Answers, 1 is accepted

Sort by
0
Erwin
Top achievements
Rank 2
answered on 27 Jul 2011, 03:44 PM
Both Panes in the RadPaneGroup have the IsSelected property binded to boolean values, which are always opposed (true & false or false&true).
When the binded properties change, the panes do switch, but the pane content of the prior pane is still visible (so header and 'tab' do change).
Also, the SelectionChanged event on the RadPaneGroup does not fire.
How do I get the RadpaneGroup.SelectionChanged event fired? 

0
George
Telerik team
answered on 28 Jul 2011, 08:58 AM
Hello Erwin,

 
Thank you for contacting us.

If I understand your scenario correctly, you want to show the content only for the active pane (active means selected and focused). Please, correct me if I am wrong. With the current Q2 release we introduced the RadDocking.ActivePane, RadPane.IsActive properties and the RadDocking.ActivePaneChanged event. Using these properties and event, you could easily get the current pane, show the content only for this pane and hide content of the others.


Hope this helps. Please do not hesitate to contact us if you require any further information.


All the best,
George
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Erwin
Top achievements
Rank 2
answered on 28 Jul 2011, 02:46 PM
Thank you for reply. For the visiblity, isselected I have made properties in the viewmodel, and the two panes bind to them.

The properties you mention on radDocking level work fine; I can see them change to the correct values when I select a pane by mouse.
However, when my Isslected and Visiblity properties change, the radDocking_ActivePaneChanged event does not fire, I think because I have to put Focus on the selected Pane. I don't know how to do it from the code behind.

Is it possible to get a small sample for this?

Thanks in advance,

Erwin
0
George
Telerik team
answered on 03 Aug 2011, 08:58 AM
Hi Erwin,

 
If order to set ActivePane for the RadDocking control, I would suggest using the RadDocking.ActivePane property. Anyway, if you want to activate it using Focus, please make sure this pane is selected and then focus it, using the Focus() method. Also, I would suggest using the RadPane.IsHidden property instead of Visibility, because the RadPane is only the small tab item in the RadPaneGroup and the content of the pane if placed in the RadPaneGroup, not in the pane and if you set it hidden, it will hide its content as well.

Hope this helps.

Kind regards,
George
the Telerik team

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

Tags
Docking
Asked by
Erwin
Top achievements
Rank 2
Answers by
Erwin
Top achievements
Rank 2
George
Telerik team
Share this question
or