Unpinned panels close when using RadDropDownButton...

5 posts, 1 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 10 Nov 2011 Link to this post

    Please take a look at the following RadDocking control...  it contains a main document host area and three simple panes, initially docked at the bottom.

    1) Run the sample and unpin each of the bottom panes.
    2) Hover the tab for the 3rd pane 'CCC' and notice that it opens revealing a RadDropDownButton control...
    3) Click the RadDropDownButton to open it's radmenu.  As soon as you hover the popup containing the radmenuitems, the RadDocking panel will start to slide closed...

    <telerik:RadDocking>
     
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup >
                            <telerik:RadPane CanUserClose="False">
                                <Border Background="Pink" BorderBrush="Red" BorderThickness="3" />
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
     
                <telerik:RadSplitContainer InitialPosition="DockedBottom" telerik:DockingPanel.InitialSize="1,260">
                    <telerik:RadPaneGroup x:Name="paneGroup" TabStripPlacement="Bottom" TabOrientation="Horizontal">
                 
                        <telerik:RadPane x:Name="paneA" Title="AAA" Header="AAA" CanUserPin="True" CanUserClose="False" CanFloat="False" CanDockInDocumentHost="False" ContextMenuTemplate="{x:Null}">
                            <Border Background="LightBlue" BorderBrush="Blue" BorderThickness="3" />
                        </telerik:RadPane>
                         
                        <telerik:RadPane x:Name="paneB" Title="BBB" Header="BBB" CanUserPin="True" CanUserClose="False" CanFloat="False" CanDockInDocumentHost="False" ContextMenuTemplate="{x:Null}">
                            <Border Background="YellowGreen" BorderBrush="Green" BorderThickness="3" />
                        </telerik:RadPane>
                         
                        <telerik:RadPane x:Name="paneC" Title="CCC" Header="CCC" CanUserPin="True" CanUserClose="False" CanFloat="False" CanDockInDocumentHost="False" ContextMenuTemplate="{x:Null}">
                            <Border Background="PaleGoldenrod" BorderBrush="Gold" BorderThickness="3">
                                <telerik:RadDropDownButton Content="Options" Height="50" Width="100">
                                    <telerik:RadDropDownButton.DropDownContent>
                                        <telerik:RadContextMenu StaysOpen="True">
                                            <telerik:RadMenuItem Header="1" IsCheckable="True" />
                                            <telerik:RadMenuItem Header="2" IsCheckable="True" />
                                            <telerik:RadMenuItem IsSeparator="True"/>
                                            <telerik:RadMenuItem Header="3" IsCheckable="True" />
                                            <telerik:RadMenuItem Header="4" IsCheckable="True" />
                                        </telerik:RadContextMenu>
                                    </telerik:RadDropDownButton.DropDownContent>
                                </telerik:RadDropDownButton>
                            </Border>
                        </telerik:RadPane>
                         
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>

  2. Answer
    Joe Schick
    Joe Schick avatar
    14 posts
    Member since:
    Oct 2009

    Posted 14 Nov 2011 Link to this post

    I've run into this same problem. It appears to be a bug in the docking control that occurs whenever a popup control is used. In the project I'm working on I have a common usercontrol called PaneView that all my views inherit from. The following code in this class seems to have solved the problem for me.
    using System;
    using System.Linq;
    using System.Windows.Controls;
    using System.Windows.Input;
    using System.Windows.Media;
    using Telerik.Windows.Controls;
     
    namespace Workaround
    {
        public class PaneView : UserControl
        {      
            public PaneView()
            {           
                MouseLeave += OnMouseLeave;
                MouseEnter += OnMouseEnter;
            }
     
            private int _popupCount;
     
            private void OnMouseEnter(object sender, MouseEventArgs e)
            {
                _popupCount = VisualTreeHelper.GetOpenPopups().Count();
            }
     
            private void OnMouseLeave(object sender, MouseEventArgs e)
            {
                var pops = VisualTreeHelper.GetOpenPopups();
                var newPopupCount = pops.Count();
                if (newPopupCount <= _popupCount)
                    return;
                _popupCount = newPopupCount;
                ActivatePane();
            }
     
            private void ActivatePane()
            {
                var pane = Parent as RadPane;
                var docking = this.ParentOfType<RadDocking>();
                if (docking != null)
                {
                    docking.ActivePane = pane;
                }
            }       
        }
    }

  3. DevCraft banner
  4. Joe Schick
    Joe Schick avatar
    14 posts
    Member since:
    Oct 2009
  5. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 15 Nov 2011 Link to this post

    Hi,

    This issue is now fixed and you can test it with the latest internal build.

    As explained into the PITS item, this still happens only with Context Menu because by default the right click doesn't focus any element and that is why the RadPane is hiding. In order to workaround this you have to select the element you clicked by some custom code.

    We are sorry for the inconvenience caused.

    Regards,
    Ivo
    the Telerik team

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

  6. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 17 Nov 2011 Link to this post

    Thanks Joe. Hate the fact that I had to do this... but your solution worked well...
Back to Top
DevCraft banner