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

Where in page lifecycle to load saved dock layout?

4 Answers 60 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Iron
Iron
Rob asked on 29 Mar 2019, 09:48 AM

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

4 Answers, 1 is accepted

Sort by
0
Rob
Top achievements
Rank 1
Iron
Iron
answered on 02 Apr 2019, 10:21 AM
Anyone?
0
Dilyan Traykov
Telerik team
answered on 02 Apr 2019, 02:01 PM
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.
0
Rob
Top achievements
Rank 1
Iron
Iron
answered on 08 Apr 2019, 06:14 PM

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

 

0
Dilyan Traykov
Telerik team
answered on 09 Apr 2019, 01:02 PM
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.
Tags
Docking
Asked by
Rob
Top achievements
Rank 1
Iron
Iron
Answers by
Rob
Top achievements
Rank 1
Iron
Iron
Dilyan Traykov
Telerik team
Share this question
or