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

Handling RadPane docked/floating event

15 Answers 670 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Pascal GUERY
Top achievements
Rank 1
Pascal GUERY asked on 21 Oct 2013, 08:37 AM
Hi everyone,

I am developing a WPF application in which I use RadControls including RadDocking.
I want to execute code when a RadPane becomes docked or floating.
Is an event raised when a RadPane becomes docked or floating ?

Thank you in advance for your help

15 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 21 Oct 2013, 03:08 PM
Hello Pascal,

You can use either the Pin/Unpin events of the Docking control or the PaneStateChange event inside which handler you can check the state of the Pane. For more detailed information about the events of the Docking you can check the following article from our online help documentation:
http://www.telerik.com/help/wpf/raddocking-events-overview.html

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 21 Oct 2013, 07:24 PM
Thank you for your answer.
I have implemented an handler for the PaneStateChange event.
Here is an extract from my handler :

private void DockingPaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    RadPane l_pane = e.OriginalSource as RadPane;
    RadPaneGroup l_group = l_pane.PaneGroup;
    // ...
}

I have launched my application.
A RadPane has been docked into a RadPaneGroup in the beginning of the execution.
The RadPaneGroup's Name property was set to "m_group1".
The RadPaneGroup was referenced by an instance property named Groupe1.

Then I have made the RadPane floating by draging it out.
The execution has stopped at a breakpoint in my handler.
I have noticed that l_group.Name has returned an empty string.
In addition I have noticed that l_group did not refer to the RadPaneGroup referred by Groupe1 property.

How can I get a reference to the RadPaneGroup from which the RadPane has been undocked ?
I can not use the Groupe1 property because a RadPane can be added to other groups.

Thank you for your future answer
0
Kalin
Telerik team
answered on 24 Oct 2013, 12:15 PM
Hi Pascal,

The Pane is moved out of its original PaneGroup when dragged out, so you will have no reference to the original group. However as a suggestion on how to restrict the Pane from docking to another PaneGroup you could implement a Conditional Docking. Please note that the Panes and PaneGroups should have names, this way you could check whether to restrict the docking or not. For your convenience I have prepared and attached here a sample project which demonstrates the exact approach.

Hope this work for you. If you have any further questions let us know.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 24 Oct 2013, 02:21 PM
Thank you for your answer.
I have got another issue relative to the PaneStateChange event.

Here is my initial Docking's layout :
<?xml version="1.0" encoding="utf-8"?>
    <RadDocking>
      <DocumentHost>
        <RadSplitContainer SerializationTag="m_splitContainer2" Orientation="Vertical">
          <Items>
            <RadPaneGroup SerializationTag="m_paneGroup2" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
            <RadPaneGroup SerializationTag="m_paneGroup3" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </DocumentHost>
      <SplitContainers>
        <RadSplitContainer SerializationTag="m_splitContainer1" Dock="DockedLeft" Width="240">
          <Items>
            <RadPaneGroup SerializationTag="m_paneGroup1" SelectedIndex="-1">
              <Items />
            </RadPaneGroup>
          </Items>
        </RadSplitContainer>
      </SplitContainers>
    </RadDocking>

A RadPane is made floating programmatically in the runtime beginning.
The RadPane is contained in a RadPaneGroup named m_paneGroup4 which is itself contained in a RadSplitContainer named m_splitContainer3.

I have docked the RadPane into m_paneGroup2 by draging the RadPane.
A breakpoint was hitted in my PaneStateChange event handler.
The RadPane's IsFloating property was set to false and that is what I expected.
The RadPane's PaneGroup property was referring to m_paneGroup4 but I expected m_paneGroup2.
Then I have pressed F5 to continue program run.

The breakpoint was hitted again before I was able to do anything.
The RadPane's PaneGroup property was set to null.

Why the RadPane's PaneGroup property was not referring to m_paneGroup2 in my event handler ?

Thank you in advance for your help.
0
Kalin
Telerik team
answered on 28 Oct 2013, 07:39 AM
Hi Pascal,

When the Pane is docked to a particular PaneGroup, its PaneGroup property holds a reference to that PaneGroup. I created a sample project which tests the scenario and works as expected, please check the attachment.

Hope this helps. If you have any other questions let us know.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 28 Oct 2013, 08:39 AM
Thank you for your rich answer.

I have performed a test in your sample project.
1.png shows the UI before the test.

Here are the steps I have followed :
  1. I have clicked Float Pane 1 button. 2.png shows the UI after this step.
  2. I have dragged Pane1 into PaneGroup2. 3.png shows the UI during this step. 4.png shows the UI after this step. PaneGroup2's name is not displayed in TextBlock. Is it normal ?

Thank you in advance for your help.
0
Kalin
Telerik team
answered on 28 Oct 2013, 01:56 PM
Hello Pascal,

The project works correctly on our side using the latest version of the controls. Could you please let us know which version you are using, so we can investigate the explained issue further?

I'm looking forward to your response.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 28 Oct 2013, 04:30 PM
Hi,

Here are the versions of the Telerik assemblies I have referenced in your project :
Telerik.Windows.Controls
Version : 2012.2.912.40
File Version : 2012.2.0912.40

Telerik.Windows.Controls.Docking
Version : 2012.2.912.40
File Version : 2012.2.0912.40

Telerik.Windows.Controls.Navigation
Version : 2012.2.912.40
File Version : 2012.2.0912.40

Telerik.Windows.Data
Version : 2012.2.912.40
File Version : 2012.2.0912.40

I hope this helps.
0
Kalin
Telerik team
answered on 29 Oct 2013, 09:59 AM
Hi Pascal,

We tested the project with the mentioned version and the explained behavior was present. However as this is fixed in the later version of the Control I would recommend that you upgrade to the latest Q3 2013 version in order to avoid that issue.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 29 Oct 2013, 10:05 AM
Thank you for your answer.

Can you please confirm me the following behavior under the latest Q3 2013 version :
Does the PaneGroup property correctly hold a reference to the destination PaneGroup when the RadPane is docked into a PaneGroup in the DocumentHost SplitContainer ?
0
Pascal GUERY
Top achievements
Rank 1
answered on 30 Oct 2013, 10:32 AM
I am replying to this thread to signal I have edited my previous post.
0
Kalin
Telerik team
answered on 30 Oct 2013, 10:33 AM
Hello Pascal,

I confirm that this issue is not present with the latest version of the controls (Q3 2013). I've also recorded a video with the test project which demonstrates the correct behavior.

If you have any other questions let us know.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 10 Nov 2013, 09:26 PM
Hi,

I have created a sample application using the trial version 2013.3.1016.40 of RadControls for WPF.
Here is the markup of the main window :

<Window x:Class="PaneStateChange.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadDocking PaneStateChange="DockingPaneStateChange">
            <telerik:RadSplitContainer InitialPosition="DockedLeft" Width="240">
                <telerik:RadPaneGroup>
                    <telerik:RadPane x:Name="m_pane">
                        <TextBlock>TextBlock</TextBlock>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup x:Name="m_paneGroup1">
 
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>
    </Grid>
</Window>

Here is the code-behind of the main window :

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
 
        m_pane.MakeFloatingDockable();
    }
 
    private void DockingPaneStateChange(object p_sender, Telerik.Windows.RadRoutedEventArgs p_args)
    {
        RadPane l_pane = (RadPane)p_args.OriginalSource;
        RadPaneGroup l_paneGroup = (RadPaneGroup)l_pane.PaneGroup;
    }
}

I have set a breakpoint on the closing bracket of the DockingPaneStateChange handler and then I have launched the application.
I have manually docked m_pane into m_paneGroup1.
The breakpoint in DockingPaneStateChange has been hitted but l_paneGroup was null.
It seems this issue has not been solved in the Q3 2013 version.
0
Kalin
Telerik team
answered on 11 Nov 2013, 03:44 PM
Hello Pascal,

Thanks for the provided sample code. When the Pane is docked into the DocumentHost the PaneStateChanged event is called more than once (in this case twice) as it is triggered from internal changes of the Pane. And on the second call the PaneGroup property of the Pane is already updated and it is pointing to the correct group. So if you need the PaneGroup on the first time the event is raised you will have to use a Dispatcher, I have attached a sample project which demonstrates the exact approach.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Pascal GUERY
Top achievements
Rank 1
answered on 12 Nov 2013, 11:12 AM
Thank you for your answer.
I have tested your solution and it works as expected.
Tags
Docking
Asked by
Pascal GUERY
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Pascal GUERY
Top achievements
Rank 1
Share this question
or