Where in page lifecycle to load saved dock layout?

5 posts, 0 answers
  1. Rob
    Rob avatar
    27 posts
    Member since:
    Feb 2012

    Posted 29 Mar 2019 Link to this post

    I am using the savelayout and loadlayout functions to save and load dock layout. This is working as expected.

    The issue I'm having is where I should put the loadlayout code in the page lifecycle. 

    If I add the load function to the constructor as expected the layout is ignored and the default is used. If I add the load function to the contentrendered code the user see's the dock jerk from one layout to another. 

    Ideally I don't want the user to see the move from default to loaded layouts.

    Can you explain how I achieve this please?

    Many thanks

    R

  2. Rob
    Rob avatar
    27 posts
    Member since:
    Feb 2012

    Posted 02 Apr 2019 in reply to Rob Link to this post

    Anyone?
  3. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1053 posts

    Posted 02 Apr 2019 Link to this post

    Hello Rob,

    The constructor of the parent user control or window would normally be the best place to load the layout.

    I've prepared a small sample project where doing so correctly loads the last-saved layout at my end.

    Could you please have a look and let me know how this project differs from the setup at your end?

    I will be looking forward to your reply.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Rob
    Rob avatar
    27 posts
    Member since:
    Feb 2012

    Posted 08 Apr 2019 in reply to Dilyan Traykov Link to this post

    Dilyan,

     

    Many thanks for your reply and the attached sample. Your sample is almost verbatim the method I've tried in my project. I think the issues stem from the fact I have 8 or 9 radpanes all with radgridviews/toolbars/buttons etc. in them. I think it's simply a case of WPF not drawing the screen quick enough?

    Not sure what to do next?

     

    Regards,

     

    Rob

     

  5. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1053 posts

    Posted 09 Apr 2019 Link to this post

    Hi Rob,

    I tried to add more panes to the setup but the LoadLayout still works as expected at my end. Would you find it possible to replicate the issue in the sample project I provided and send it back to me?

    I can also suggest trying to invoke the method via the Dispatcher, if you believe that it is due to a timing issue:

    public MainWindow()
    {
        InitializeComponent();
        Dispatcher.BeginInvoke(new Action(() =>
        {
            this.LoadLayoutFromFile();
        }), DispatcherPriority.Render);
    }

    Please let me know how this goes.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top