refresh after delete folder

2 posts, 0 answers
  1. Hamdy
    Hamdy avatar
    41 posts
    Member since:
    Dec 2009

    Posted 04 Aug 2010 Link to this post

    I have file explorer control
    I did the manual delete event in the ItemCommand event

     Protected Sub FileExplorer1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFileExplorerEventArgs) Handles FileExplorer1.ItemCommand
    Select Case e.Command
                    Case "DeleteDirectory"
                        Dim dirInfo As New DirectoryInfo(sCurrentFolder)
                            sCurrentFolder = e.Path.Substring(InStr(e.Path, sBaseDir) + Len(sBaseDir)) + "\"
                            FileSystemUtils.DeleteFolder(SiteId, dirInfo, sCurrentFolder)
                            ScriptManager.RegisterStartupScript(Me.Page, Page.[GetType](), "RefreshAfterAddFolder", "setTimeout ('RefreshAfterAddFolder();',3500);", True)

    in the aspx I put that JS function

       function RefreshAfterAddFolder() {
                    var oExplorer = $find('FileExplorer1');

    Every thing was OK in the local but after publishing the site I have this error
    Callback loading error
    please see the attachment photo

    I removed the line  oExplorer.refresh(); from the JS function it works but sure not refreshing
    What to do???

  2. Fiko
    Fiko avatar
    1406 posts

    Posted 09 Aug 2010 Link to this post

    Hello Hamdy,

    RadFileExplorer control is based on MS AJAX client-side framework and it needs that Framework to be fully loaded in order to use the RadFileExplorer's clint-side object. This is why you need to use the Load event of the framework in order detect when its is fully loaded. Then you can find the RadFileExplorer control and call its methods.

    In addition, I recommend you to cancel the ItemCommand event (e.Cancel = true). I recommend you this in order to avoid two simultaneous callbacks at the same time: the first one which is triggered when a file/folder is deleting and the second one which will occur when the oExplorer.refresh(); is called.

    In case that the suggested does not help, could you please open a new support ticket and send me a runnable project which shows the problem? I will rework it in order to make it to work and send it back.

    I hope this helps.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top