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