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

Unpinned panels close when using RadDropDownButton...

4 Answers 68 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 10 Nov 2011, 09:48 PM
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>

4 Answers, 1 is accepted

Sort by
0
Accepted
Joe Schick
Top achievements
Rank 1
answered on 14 Nov 2011, 05:31 PM
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;
            }
        }       
    }
}

0
Joe Schick
Top achievements
Rank 1
answered on 14 Nov 2011, 05:38 PM
0
Ivo
Telerik team
answered on 15 Nov 2011, 09:39 AM
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 >>

0
Rob
Top achievements
Rank 1
answered on 17 Nov 2011, 11:05 PM
Thanks Joe. Hate the fact that I had to do this... but your solution worked well...
Tags
Docking
Asked by
Rob
Top achievements
Rank 1
Answers by
Joe Schick
Top achievements
Rank 1
Ivo
Telerik team
Rob
Top achievements
Rank 1
Share this question
or