This is a migrated thread and some comments may be shown as answers.

force refresh on folder selection?

6 Answers 267 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Xorcist
Top achievements
Rank 1
Xorcist asked on 15 Jul 2011, 04:08 PM
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.

6 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 19 Jul 2011, 03:58 PM
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!

0
Xorcist
Top achievements
Rank 1
answered on 20 Jul 2011, 05:02 PM
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?
0
Dobromir
Telerik team
answered on 22 Jul 2011, 02:10 PM
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!

0
Rohan
Top achievements
Rank 1
answered on 25 Sep 2012, 02:43 PM

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 ……….

0
Vessy
Telerik team
answered on 28 Sep 2012, 12:49 PM
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.
0
Rohan
Top achievements
Rank 1
answered on 29 Oct 2012, 08:23 AM
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 ,

Tags
FileExplorer
Asked by
Xorcist
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Xorcist
Top achievements
Rank 1
Rohan
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or