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

Docking and Ribbon

7 Answers 69 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Domenico
Top achievements
Rank 2
Domenico asked on 17 Sep 2015, 02:17 PM

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

Sort by
0
Domenico
Top achievements
Rank 2
answered on 17 Sep 2015, 02:19 PM
0
Accepted
Kalin
Telerik team
answered on 18 Sep 2015, 08:13 AM
Hello Domenico,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Domenico
Top achievements
Rank 2
answered on 18 Sep 2015, 09:55 AM

Thank you for your help.

Your example solves my problem

Kind regards

 

0
Domenico
Top achievements
Rank 2
answered on 21 Sep 2015, 07:01 AM

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

 

0
Kalin
Telerik team
answered on 23 Sep 2015, 08:55 AM
Hi 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Domenico
Top achievements
Rank 2
answered on 23 Sep 2015, 11:43 AM

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

0
Kalin
Telerik team
answered on 24 Sep 2015, 08:05 AM
Hello Domenico,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
Domenico
Top achievements
Rank 2
Answers by
Domenico
Top achievements
Rank 2
Kalin
Telerik team
Share this question
or