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

FileExplorer stops working when visibility is toggled

1 Answer 81 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Jenna Schmidt
Top achievements
Rank 1
Jenna Schmidt asked on 31 Mar 2009, 05:08 PM
Hi,

I am running into a problem with the FileExplorer. Here is how I have my page setup:

The FileExplorer is in a placeholder which starts with visible=true.
When a button on the page is clicked, the placeholder containing the FileExplorer is set to visible=false.
When another button on the page is clicked, the placeholder containing the fileexplorer is set back to visible=true

After the second button is clicked and the fileexplorer becomes visible again, it no longer works. No items load in the right pane. I copied the following code for the initialization of the fileexplorer on page_load from the demo located at http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/default/defaultcs.aspx

Protected Sub Page_Load(ByVal sender As ObjectByVal e As EventArgs) 
            FileExplorer1.EnableViewState = False 
            UpdateVisibleControls() 
            FileExplorer1.EnableOpenFile = enableOpenFile.Checked 
            FileExplorer1.DisplayUpFolderItem = displayUpFolder.Checked 
            If Not enableUpload.Checked Then 
                FileExplorer1.Configuration.UploadPaths = New String(0) {} 
            End If 
            FileExplorer1.InitialPath = Page.ResolveUrl("~/FileExplorer/Examples/Default/Images/Northwind/Flowers/"
        End Sub 
        Protected Sub UpdateVisibleControls() 
            Dim explorerControls As Telerik.Web.UI.FileExplorer.FileExplorerControls = 0 
            If visibleControls.Items(0).Selected Then 
                explorerControls = explorerControls Or Telerik.Web.UI.FileExplorer.FileExplorerControls.AddressBox 
            End If 
            If visibleControls.Items(1).Selected Then 
                explorerControls = explorerControls Or Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid 
            End If 
            If visibleControls.Items(2).Selected Then 
                explorerControls = explorerControls Or Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar 
            End If 
            If visibleControls.Items(3).Selected Then 
                explorerControls = explorerControls Or Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView 
            End If 
            FileExplorer1.VisibleControls = explorerControls 
        End Sub 



After running into the problem, I thought that the fileexplorer might need to be re-initialized after having its visibility toggled, so I tried running the above code again. It did not work, so I tried running just certain parts of it, and it still did not work.

Any ideas?

Thanks,
Jenna



1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 01 Apr 2009, 12:01 PM
Hello Jenna,

On the example we set a value "false" to the EnableViewState property for demonstration purposes only. In a real scenario we do not recommend to set it to "true" because of possible problems - such as in your scenario.

Best wishes,
Fiko
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
FileExplorer
Asked by
Jenna Schmidt
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or