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

RadPageVIew Size

1 Answer 225 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 30 Apr 2019, 08:50 PM

I have an application in which I create the GUI controls programatically without using the designer.  The main body of the application uses a RadPanel which has a RadPageView docked to fill with several RadPageViewPages.

When creating the pages, I create all the controls for each page from the constructor and program the layout and size of the controls in the resize event.  There are several custom RadListView and Gridview's which need to be sized according to the size of the screen dimensions.

The problem I have is that the actual size of the Page does not seem to take effect until it is actually displayed in form itself.  The initial display of the page does not trigger the resize event the first time, but does if I re-call the sizing method once it is displayed on screen.

In order to fix this, I'm using a "dirty" method of displaying a splashscreen on top of the form, and displaying the pages one by one in the background once the main form's Main_Shown() is triggered.  Once all pages have been displayed the first time, I select the start page and close the splashscreen to show the application.  This works "fine" in that the components all have the right layout and sizing because they have already been displayed once, but I would like to know if there's a better way to go about this.  I don't want to have to rely on hiding and toggling through all the pages as a method of setting the correct sizes for the components and their visual items.

I have tried calling the layout setting method from Resize and SizeChanged events in the RadPaveViewPages, but this does not seem to work.

Thanks

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 May 2019, 09:24 AM
Hello Mike,

Your approach seem correct to me and I do not see a reason not to use it. What else you can do is call your layout method when the forms is shown or loaded (the Shown or Load events). You can call the LoadElementTree method before calling your method since it will force the control creation.

If this is not working would it be possible to share the code of the application. Perhaps if you could give me an example of what is not working (2 pages where the one is not visible and the layout is not initialized) we will be able to suggest a better solution. 

I hope this will be useful. I am looking forward to your reply.

Regards,
Dimitar
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
PageView
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or