RadPane size changing on float

7 posts, 0 answers
  1. Martin
    Martin avatar
    19 posts
    Member since:
    Oct 2012

    Posted 28 Feb 2012 Link to this post

    I would like the RadPane to stay the same size when the users drags it to make it go from being docked to being floating, currently it resizes itself. I've seen this thread, but that does not cover how to actually keep it the same size as when it was docked. Possibly another technique would be to use the attached property RadDocking.FloatingSize and bind it to something rather than setting an absolute value, I don't know how this would work though.

    thanks
  2. Martin
    Martin avatar
    19 posts
    Member since:
    Oct 2012

    Posted 01 Mar 2012 Link to this post

    Is there no solution to this? It would seem to me that the behaviour I am looking for should not only be possible, but should actually be the default. After all, if you look at any other program that has a similar type of docking (such as visual studio), they work how I have described, i.e. the panes maintain their size when floated.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 05 Mar 2012 Link to this post

    Hi Martin,

    Unless you know the specific size of the RadPane before dragging and it doesn't change (which will happen once it is dragged), then this cannot be achieved with the current implementation of the control. Unfortunately, there is no way to obtain the size of the RadPaneGroup before the PaneStateChange event, in which its size is already 0,0.
    We will consider implementing such feature if we receive more clients' requests.

    Regards,
    Konstantina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Martin
    Martin avatar
    19 posts
    Member since:
    Oct 2012

    Posted 05 Mar 2012 Link to this post

    1) Do you accept that other programs (notably visual studio which otherwise has almost identical docking functionality to yours) works in the manner I have described.

    2) Do you accept that having the panes arbitrarily resize when dragged will often give a very poor user experience.
  6. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 07 Mar 2012 Link to this post

    Hi Martin,

    We are aware of this issue with the Docking control - as you correctly mentioned, we are struggling to make the RadDocking behave as the VS docking. However, the RadDocking supports for now only relative sizing, in order to be able to support absolute sizing it needs to be majorly refactored. We have logged this request in PITS. You can vote for it and track its status. You will be notified when we start working on this request.

    Greetings,
    Konstantina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  7. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 20 Jun 2012 Link to this post

    While you're waiting for "major refacoring" try this...
    private void OnPaneStateChange(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        var radDock = sender as RadDocking;
        if (radDock.IsLayoutChanging)
        {
            var pane = e.OriginalSource as RadPane;
            if (pane != null)
            {
                var view = pane.Content as UserControl;
                Size size = new Size(view.ActualWidth, view.ActualHeight);
                Point loc = radDock.PointToScreen(new Point(0, 0));
                var win = pane.GetParentToolWindow();
                if (win != null)
                {
                    win.Left = loc.X;
                    win.Top = loc.Y;
                    win.Height = size.Height;
                    win.Width = size.Width;
                    pane.Visibility = Visibility.Collapsed;
                }
                else
                {
                    pane.Visibility = Visibility.Visible;
                }
            }
        }
    }

    There is a slight shrinkage due to the fact that the method uses the height and width of the pane.Content; however with a little tweaking you could probably adjust for it.  Personally I didn't think it was worth it.  Btw - the diddling with the pane.Visiblity was due to the fact that when the pane was a RadDocumentPane, its tab showed up in the lower left corner of the ToolWindow.

    Hope this helps,
    Steve









  8. Ben
    Ben avatar
    4 posts
    Member since:
    Jul 2015

    Posted 05 Aug 2015 in reply to Steve Link to this post

    The wait is over :-)

    http://docs.telerik.com/devtools/wpf/controls/raddocking/features/retain-pane-size​

Back to Top
UI for WPF is Visual Studio 2017 Ready