Dear
Telerik Support Team,
I am using
version 2015.2.623.45 to replace Syncfusion components with Telerik ones.
Now is Docking
turn. One of customer request is to open different tools and dock them in a
Document view. Each tool (a User Control) has it’s own Ribbon that has to be
merged with the one on the main window. I succeeded in my porting but to fulfil
all requirements I need also to know (with an event) when a document-docked
control has been selected. I did not find an event to hook that could be used.
In attachment,
you can find a sample project.
Can you
help me?
Thank you
Domenico
7 Answers, 1 is accepted
You would be able to achieve the desired by using the ActivePaneChanged event of RadDocking. However I can see in the project you have already tried that and it wasn't working. It is so because the Docking definition is incorrect. What I can suggest in order to get it working correctly would to be add only one PaneGroup and SplitContainer in the DocumentHost and then just keep adding the new Panes in the current PaneGroup. Please replace the LoadUserControl method with the following snippet and the ActivePaneChanged will be fired as expected:
public
void
LoadUserControl(BuilderControl userControl,
string
caption =
""
)
{
// hooks the Loaded/unloaded events to manage the dynamic ribbon merging
userControl.Loaded += UserControl_Loaded;
userControl.Unloaded += UserControl_Unloaded;
var hostContainer =
new
RadSplitContainer();
var hostGroup =
new
RadPaneGroup();
if
(MainDockManager.DocumentHost ==
null
)
{
hostContainer.Items.Add(hostGroup);
MainDockManager.DocumentHost = hostContainer;
}
else
{
hostGroup = ((RadSplitContainer)MainDockManager.DocumentHost).Items[0]
as
RadPaneGroup;
}
var radDocumentPane =
new
RadDocumentPane { Header = userControl.Name, Content = userControl };
radDocumentPane.Loaded += RadDocumentPaneOnLoaded;
radDocumentPane.Unloaded += RadDocumentPaneOnUnloaded;
hostGroup.Items.Add(radDocumentPane);
}
Hope this helps.
Regards,
Kalin
Telerik
Thank you for your help.
Your example solves my problem
Kind regards
Hi there,
two questions about docking:
1. How can I obtain the State of the Pane from the StateChangeEventArgs argument of Docking PaneStateChange event?
2. I need an event telling that a Pane in closing with the possibility to Cancel the action in order to allow the user to discard or not pending chenges. The Docking.ActivePaneChanged do not allow that and I did not found an event with Cancel possibility. Can you help me? I really need such event to replace Syncfusion Docking with Telerik one
Thanks in advance
King regards
Domenico
I'll go straight to your questions:
1. You can check the IsFloating property of RadPane in order to know whether the Pane is currently floating or not.
2. You could use the PreviewClose event of RadDocking and to handle it if you don't want to close the Pane.
Hope this helps.
Regards,
Kalin
Telerik
Thank you Kalin,
For item 1. we would like to know more about Pane docking state suck as the position where the pane is (top, left...), but for now it's not so important, we can workaround the requisite
For item 2. ok I'll use the PreviewClose event and I'll set Handled property to false when the pane has not to be closed.
Best regards
What I can suggest you would be to check the following example from our online XAML SDK repository:
https://github.com/telerik/xaml-sdk/tree/master/Docking/SplitContainerDockState
It demonstrates how to get current dock position.
Hope this helps.
Regards,
Kalin
Telerik