I have a RadMultiPage with multiple RadPageView, some of which are created dynamically. The page starts with one RadPageView and the user can add more via a button. The initial code is something like the one bellow.
<telerik:RadMultiPage ID="ContactsPagesViews" ScrollBars="Auto" Height="100%" RenderMode="Lightweight" runat="server" OnPageViewCreated="ContactsPagesViews_PageViewCreated" SelectedIndex="0"> <telerik:RadPageView ID="RadPageView1" runat="server" Height="600px"> more elements here </telerik:RadPageView></telerik:RadMultiPage>I also have some code to resize my RadPageViews to fit the size of my window. For this I use the following code:
01.<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">02. <script type="text/javascript">03. $(document).ready(function () {04. 05. $(window).resize(function () {06. ResizePage($find('<%= ContactsPagesViews.ClientID %>'))07. });08. 09. ResizePage($find('<%= ContactsPagesViews.ClientID %>'))10. });11. 12. function ResizePage(multiPage) {13. for (i = 0; i < multiPage.get_pageViews().get_count() ; i++) {14. var pageView = multiPage.get_pageViews().getPageView(i);15. pageView.get_element().style.height = ($(window).height() - 80) + 'px';16. }17.}18. </script>19.</telerik:RadScriptBlock>The Resizing is working really great but the first time the page is loaded the initial RadPageView is not resized. You can see line 9. where I'm trying to force it but it only resizes if I change the size of the window. Is there anyway for this to work?
Thank you.
