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

RadDocumentPane events do not register when using LoadLayout

1 Answer 73 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 09 Jun 2009, 08:06 AM
Hi,

We are currently implementing the Docking control in our application. As a service to the user
we want to save the current layout when the applications exits and load it when the user starts
the application again.

We have a document panel that shows the open documents of the user and a empty
document with an icon in the header that, when a user clicks it, creates a new document
(like Internet Explorer 7 - 8 tab panel). We do this by registering for the SelectionChanged
event of the RadPaneGroup.

The problem is that, when we use the LoadLayout method, the SelectionChanged event doesn't
get registered/fired either using XAML or hooking it up in the codebehind.

Have you got any suggestions? A trimmed version of the code is listed below.

Kind regards,

Jerome

        <radDock:RadDocking x:Name="DockingScreen">  
 
            <radDock:RadDocking.DocumentHost> 
                <radDock:RadSplitContainer> 
                    <radDock:RadPaneGroup x:Name="DocumentPane" SelectionChanged="DocumentPane_SelectionChanged" > 
                        <radDock:RadDocumentPane x:Name="NewTab" CanFloat="False" CanUserClose="False" CanUserPin="False" HeaderTemplate="{StaticResource NewTabStyle}" radDock:RadDocking.SerializationTag="NewTabPanel" /> 
                    </radDock:RadPaneGroup> 
                </radDock:RadSplitContainer> 
            </radDock:RadDocking.DocumentHost> 
 
        </radDock:RadDocking x:Name="DockingScreen">  
 
 

        private void DocumentPane_SelectionChanged ( object sender, RoutedEventArgs e )  
        {  
            if ( ( ( RadPaneGroup ) sender ).SelectedPane != null )  
            {  
                if ( ( ( RadPaneGroup ) sender ).SelectedPane.Name == "NewTab" )  
                {  
                    // Logic to add new document  
                }  
            }  
        } 

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 09 Jun 2009, 03:24 PM
Hi Jerome,

When working with RadDocking's Save/Load functionality it is important to note that the element without a radDock:RadDocking.SerializationTag will be disposed after saving and loading the layout. In other words, after loading the RadDocking, the RadPaneGroup will not exist any more and thus its DocumentPane_SelectionChanged handler. This way you have to add radDock:RadDocking.SerializationTag to this RadPaneGroup so it can work as you expect.

Let us know if you need any additional information.

Best wishes, 
Kaloyan
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
Docking
Asked by
Jerome
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or