I have the following XAML.
Both Pane1 and Pane2 are docked by default and contained within the same pane group so at startup I see two tabs at the bottom and one pin/unpin button at the top. When I click the unpin button at the top I would expect the whole pane group (and thus all its RadPanes) to become undocked and slide to the left but I only see one slide to the left and the other remains open and pined.
This does not seem to be the normal behavior for a dock control, like the one used in Visual Studio itself. Is there a way to configure the Telerik dock control to behave like the dock control used by Visual Studio where when a pane group unpinned it unpins all its sub panes?
7 Answers, 1 is accepted
The Docking control is inspired from Visual Studio and provides most of the functionality seen in Visual Studio. However, indeed this particular behavior of RadDocking is not identical with the Visual Studio, but you can easily achieve the same by using the Pin and Unpin events of the control and pin/unpin all the Panes in the same group in the event handlers - check the attached sample project.
Hope this helps.
Thanks for the reply. I was able to reproduce your suggestion in our project and it worked as described. I believe that most people are going to want this behavior in a docking control so I would recommend that this be added to the Telerik product as a XAML property and/or add this simple code example to the help documentation.
Also do not call UnPinAllPanes() from the Pin Event. :-)
Thanks for your feedback - I have logged that as Feature Request in our Feedback portal. You can vote for it and track its status on the following link:
Hope this helps.
So now when I click the Pin button, to take the group from an unpinned state to an pinned state, the active RadPane is not the RadPane that was on top when I clicked the Pin button. For example, if I have RadPane(s) A, B, and C and I mouse over RadPane B and it "comes forward" (when the whole group is in an unpinned state) and click the Pin button I would expect to have RadPane B be the active RadPane once the whole group has been pinned but the active RadPane ends up being A or C.
- The order of the RadPane(s) when they are Pinned (in the group) does not match the order they are when they are all unpinned.
- Is there a way to disable the mouse over behavior of a collapsed RadPane so it does not show unless directly clicked on (this is also the behavior the Visual Studio dock control has).
- Is there a way to allow the user to reorder the RadPane(s), within the same group, by dragging the tab? (this is also the behavior the Visual Studio dock control has).
What I can suggest you for the first question would be to manually activate the needed Pane once all the Panes are Pinned. At the first time the Pin event is fired you can check the pinned.PaneGroup.Items.Count - the event will be also fired for each of the panes inside of that collection, so you can wait until last call and manually activate the first Pinned Pane by setting its IsActive property.
As for the other questions:
1. You can reorder unpinned Panes as demonstrated in the following demo from our XAML SDK repository:
2. By using custom FlyoutBehavior you could achieve that:
3. By setting the AllowDragReorder property of the Docking to True the user will be able to drag reorder the Panes.
Hope this helps.
Thanks for the reply. I took a look at the OrderedUnpinnedPanes code on github and I don't feel like that is a valid solution. That sample shows the Linq OrderBy extension which creates a new totally new collection and the code also shows adding and removing panes from the PaneGroup collection. It also looks like its ordering alphabetically based on the header name. Our panes are defined by the PanesSource, which is a collection of ViewModels, and I do not think modifying the underlying pane collection this way seems very stable. I would be worried that the DataContext would be changed as well.
Again I think this is behavior that should be part of any docking control that is based off of the Visual Studio docking environment. The Telerik RadDocking control should support the following out of the box.
1. When one RadPane is pinned/unpinned all other RadPanes in the same group should be pinned/unpinned. (you already added an enhancement request for this. Thank you).
2. When #1 above is applied the order of the panes when pinned/unpinned should match their order when pinned/unpinned.
The custom FlyoutBehavior looks interesting. I am still playing around with that and the AllowDragReorder worked. I guess I simply missed that property when looking through the help.
I would like to thank you for your feedback - it will be considered once the item is planned for implementation. I understand your concerns regarding the OrderedUnpinnedPanes example and I'm sorry it is not suitable for you - you can try to use same approach but to depend on another property responsible for the current index of the Pane. Please follow the Feedback item regarding that feature request in order to get notified once its status is changed.
If you have any other questions or concerns, please let us know.