Docking and Ribbon

8 posts, 1 answers
  1. Domenico
    Domenico avatar
    7 posts
    Member since:
    Mar 2012

    Posted 17 Sep 2015 Link to this post

    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

  2. Domenico
    Domenico avatar
    7 posts
    Member since:
    Mar 2012

    Posted 17 Sep 2015 Link to this post

    The attachment, sorry
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 18 Sep 2015 Link to this post

    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
  5. Domenico
    Domenico avatar
    7 posts
    Member since:
    Mar 2012

    Posted 18 Sep 2015 in reply to Kalin Link to this post

    Thank you for your help.

    Your example solves my problem

    Kind regards

     

  6. Domenico
    Domenico avatar
    7 posts
    Member since:
    Mar 2012

    Posted 21 Sep 2015 Link to this post

    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

     

  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 23 Sep 2015 Link to this post

    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
  8. Domenico
    Domenico avatar
    7 posts
    Member since:
    Mar 2012

    Posted 23 Sep 2015 in reply to Kalin Link to this post

    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

  9. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 24 Sep 2015 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready