force refresh on folder selection?

7 posts, 0 answers
  1. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 15 Jul 2011 Link to this post

    Is there any way to force a the grid to refresh when a treeview node is selected in the RadFileExplorer? On the first selection is appears to load up okay, but after that is seems to use the preloaded data. I need it to refresh each time the folder is selected if possible.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 19 Jul 2011 Link to this post

    Hi Xorcist,

    You can achieve the required result by handling the ClientFolderChange client-side event and call the client-side method clearFolderCache(), e.g.:

    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientFolderChange="OnClientFolderChange">
    </telerik:RadFileExplorer>
     
    <script type="text/javascript">
        function OnClientFolderChange(explorer, args)
        {
            explorer.clearFolderCache();
        }
    </script>

    Regards,
    Dobromir
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Xorcist
    Xorcist avatar
    92 posts
    Member since:
    Apr 2009

    Posted 20 Jul 2011 Link to this post

    Thanks that worked great. Separate question, same topic. If I wanted to supply a similar refresh via the treeview context menu, so that the current folder is refreshed, how would I do that. I've looking through the RadFileExplorer.js file for some hints, but haven't come up with much. I already have a context menu item setup, I just need to be able to refresh the currently selected folder.

    EDIT: I was able to get this partially working using a explorer.refresh() through the treeContextMenuClicked event, which works exactly one time. After a single refresh subsequent context menu operations fail to call the treeContextMenuClicked function. I use the following code to attach the event handler in the OnClientLoad event of the RadFileExplorer:

    var tree = explorer.get_tree();
    if (tree) { tree.add_contextMenuItemClicked(rfeBrowser_treeContextMenuClicked); }

    Any ideas why it would simply decouple after the first call?
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 22 Jul 2011 Link to this post

    Hi Xorcist,

    The client-side refresh() method of the RadFileExplorer forces refresh to both grid and treeview. When the treeview is refreshed the entire control is recreated, thus the contextmenu click handler need to be assigned again. Please review the following help article for example on how to add custom item on the treeview's context menu:
    Adding a custom button to the toolbar and an item to the tree context menu


    Kind regards,
    Dobromir
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 25 Sep 2012 Link to this post

    Hi all

    I have one external button to create folder in file explore . after the creating the folder telelrik file explore tree view not showing the current created folder but it show in grid ….i also used 

    FileExplorer1.TreeView.Nodes.Clear();

    to page load but not getting any result ……….

  7. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 28 Sep 2012 Link to this post

    Hi Rohan,

    I am not quite sure why the above provided code does not force the TreeView reloading and I will need to reproduce the problem on my side in order to provide a working solution.

    This is why, could you please open a formal support ticket an send me a fully runnable project? Once I have a better view over the implementation itself I will try to provide a solution.

    Kind regards,
    Vesi
    the Telerik team
    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 their blog feed now.
  8. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 29 Oct 2012 Link to this post

    Hi All ,

    i want force the telelrik file Explorer on folder selection ,but i am not able to force using provided code , such as
    <script type="text/javascript">
        function OnClientFolderChange(explorer, args)
        {
            explorer.clearFolderCache();
        }
    </script>
    is there any way to do fire server event every time on folder section ......

    Thank You ,

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017