Get FileExpolorer pagerindex

6 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 30 Oct 2013 Link to this post

    Hi,

    Any idea why the following clientscript always returns 0?
    var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
        alert(oExplorer.get_listView().get_currentPageIndex());

    Thanks,

    Marc
  2. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 31 Oct 2013 Link to this post

    Hello Marc,

    The ListView is the control, which is listing the files when FileExplorer's ExplorerMode is set to Thumbnais. I assume that you are using FileExplorer in the default grid mode, which means that you can access the current page index in a similar way:
    <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" AllowPaging="true" PageSize="5" ExplorerMode="Default">
        <Configuration ViewPaths="~/" />
    </telerik:RadFileExplorer>
    <asp:Button ID="Button1" runat="server" Text="Current page" OnClientClick="ShowPage(); return false;" />
    <script type="text/javascript">
        function ShowPage() {
            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
            alert(oExplorer.get_grid().get_masterTableView().get_currentPageIndex());
        }
    </script>

    I hope this helps.

    Regards,
    Veselina Raykova
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 04 Nov 2013 Link to this post

    Hi Veselina,

    That is just the point. I use ListView mode but I cannot read the PagerSetting.
    Can you reproduce this?

    Marc
  5. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 04 Nov 2013 Link to this post

    Hi Marc,

    Thank you for the clarification - indeed I was able to reproduce the described issue in Thumbnails mode of FileExplorer and I have logged it int our bug tracking system. You can see the progress of the bug here: feedback. I have also updated your Telerik Points accordingly.

    For he time being, you can use the following workaround in order to access the current page index:
    function ShowPage() {
        var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
        var slider = $find(oExplorer.get_id() + "_FileListPageControlSlider");
        var pageIndex = slider.get_value();
        alert(pageIndex);
    }

    I hope this helps.

    Regards,
    Veselina Raykova
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 05 Nov 2013 Link to this post

    Hi Veselina,

    I try to explain what my exact problem is. I discovered that the pager in the RadFileExplorer remembers it's own setting when I have the FileExplorer set on GridView. When I switch to Listview the Pager setting is not kept. I use a FileExplorer in which I added an ImageEditor to the Context menu. So let's say when I open the imageEditor for a file on page 2 and I cancel it the pager always returns to page1. In GridView it neatly stays on page 2.

    I can send code if that would you help to reproduce the problem.

    Marc
  7. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 07 Nov 2013 Link to this post

    Hello Marc,

    The pager in the GridView mode of FileExplorer is built-in the Grid control, while the one in the ListView is additionally added Slider control, so it does not provide all the functionality which come with the Grid.

    What I could suggest you is to save the current page in a hidden field (you can do it on your custom context menu item's Client-Click handler) and to set it as a value to the Slider when the ImageEditor is closed. In order to access the current value of the Slider, you can use the method provided in my previous reply:
    var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");
    var slider = $find(oExplorer.get_id() + "_FileListPageControlSlider");
    var pageIndex = slider.get_value();

    and respectively to set the desired value in a similar manner:
    slider.set_value(2); //sets the page index

    I hope this approach will be suitable for your scenario.

    Regards,
    Veselina Raykova
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017