FileExplorer Tree loses state within a MultiPage with RenderSelectedPageOnly=True

3 posts, 0 answers
  1. Santiago
    Santiago avatar
    14 posts
    Member since:
    Dec 2006

    Posted 16 Feb 2011 Link to this post

    Hi, I'm having trouble with a FileExplorer inside a MultiPage control. This is my markup code:
     
           <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="True">
                <Tabs>
                    <telerik:RadTab PageViewID="RadPageView1" Text="1" Selected="true">
                    </telerik:RadTab>
                    <telerik:RadTab PageViewID="RadPageView2" Text="2">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" RenderSelectedPageOnly="True">
                <telerik:RadPageView ID="RadPageView1" runat="server" Selected="true">
                    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Configuration-ViewPaths="/">
                    </telerik:RadFileExplorer>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server">
                    2
                </telerik:RadPageView>
            </telerik:RadMultiPage>

    At the beginning everything seems fine, I can navigate the folder as shown in the attachment 1.jpg.
    But if I change the selected tab and then return to the FileExplorer tab, the FileExplorer Tree loses its state as shown in the attachment 2.jpg. The FileExplorer Grid mantains the selected folder, but de Tree collapses to its original state and loses the selected folder.

    I found a similar issue in the forums: http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/control-gets-malformed-when-inside-radpageview-with-renderselectedpageonly-set.aspx. But it doesn't provide a solution.

    BTW, I'm using Q1 2010.

    Greetings,
    Santiago.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 22 Feb 2011 Link to this post

    Hi Santiago,

    This behavior occurs because when RadMultiPage's RenderSelectedPageOnly property is set to false, RadFileExplorer is not registered on the page when different tab is selected, but the page stores information about the control in the ViewState.

    To avoid this issue you need to manually call RadFileExplorer's refresh() method in the OnClientLoad client-side event, e.g.:
    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Configuration-ViewPaths="~/" OnClientLoad="OnClientLoad">
    </telerik:RadFileExplorer>
    <script type="text/javascript">
        function OnClientLoad(explorer, args)
        {
            explorer.refresh();
        }
    </script>

    I hope this helps.

    Best wishes,
    Dobromir
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Santiago
    Santiago avatar
    14 posts
    Member since:
    Dec 2006

    Posted 23 Feb 2011 Link to this post

    That did the trick!

    Thanks,
    Santiago.
Back to Top