Getting floating window close button to not close all tabs?

4 posts, 0 answers
  1. Matthew
    Matthew avatar
    2 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post

    Below is a simple docking application. After the app loads I tear out the panels and dock them together into a single floating window. I end up with a floating tabbed window with several tabs. If I press the close button of the floating panel the entire floating panel and all the tabbed items in it close. How would I get this to only close the active item in the tabbed view instead of all the items and the panel? E.g. if the floating panel has tabs for A, B and C, and B is active when I press close, then the panel would remain floating with tabs A and C still present. 

    <Window
            xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="RadControlsDocking.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
     
            <telerikDocking:RadDocking>
                <telerikDocking:RadDocking.DocumentHost>
                    <telerikDocking:RadSplitContainer>
                        <telerikDocking:RadPaneGroup>
                            <telerikDocking:RadDocumentPane Header="A"/>
                            <telerikDocking:RadDocumentPane Header="B"/>
                            <telerikDocking:RadDocumentPane Header="C"/>
                            <telerikDocking:RadDocumentPane Header="D"/>
                            <telerikDocking:RadDocumentPane Header="E"/>
                            <telerikDocking:RadDocumentPane Header="F"/>
                            <telerikDocking:RadDocumentPane Header="G"/>
                        </telerikDocking:RadPaneGroup>
                    </telerikDocking:RadSplitContainer>
                </telerikDocking:RadDocking.DocumentHost>
            </telerikDocking:RadDocking>
     
        </Grid>
    </Window>
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 01 Mar 2013 Link to this post

    Hello Matthew,

    By design in the RadDocking control when the close button of a floating PaneGroup is clicked it closes the ToolWindow in which the PaneGroup is placed.

    In order to achieve the desired behavior you will need to customize the ToolWindow in which the floating Panes are placed and override its OnClosing() method.

    We created and attached a sample project for you showing the described approach, hope this is helpful.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Matthew
    Matthew avatar
    2 posts
    Member since:
    Feb 2013

    Posted 01 Mar 2013 Link to this post

    Thank you for posting that Vladi. This method works, but it works by setting the Pane visibility rather than using a RemoveFromParent() call. If I attempt to use RemoveFromParent() in the overriden OnClosing() method the whole tool window still closes. Is there perhaps an extension to RemoveFromParent that can limit the Pane closing to only one pane? I'd like to get something a little more like Visual Studio in the floating pane closing behavior. For now I'm thinking of just moving the targeted pane to a new hidden tool window and then closing the panel from there. 
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 04 Mar 2013 Link to this post

    Hi Matthew,

    We tried to reproduce the issue when calling the RemoveFromParent() method in the OnClosing() method but with no success. When the Pane is removed by calling the RemoveFromParent() method only the Pane is removed not the hole ToolWindow.

    I recorded and attached a short video for you showing how the project run on our side. Could you confirm that you are using the 2013.1 220 version of RadControls as states in the post details?

    Regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top