RadPageVIew Size

2 posts, 0 answers
  1. Mike
    Mike avatar
    15 posts
    Member since:
    Mar 2018

    Posted 30 Apr Link to this post

    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

  2. Dimitar
    Admin
    Dimitar avatar
    2774 posts

    Posted 01 May Link to this post

    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.
Back to Top