I have noticed some very peculiar behavior when setting the folder of the FileExplorer from a record selected on a RadGrid. The behavior is consistent so should be able to be determined why.
Each row on the RadGrid points to a project which has as one of its not visible fields a url to its project folder on AWS.
The code to change the folder location is contained in a method that is called from RadGrid2_ItemCommand.
The FileExplorer shows the contents of the changed folder all the time but with one exception. If the currently selected Project is the first on the list, then the FileExplorer does not show the contents of the new folder whenever a different Project is selected. Reselecting the same Project will get FileExplorer to show the contents of the new folder. If the currently selected Project is anything other than the first Project, the FileExplorer will show the contents of the new folder.
I have logged the value of FileExplorer1.CurrentFolder before the change and then again after the change. When selecting away from the first Project, this value does not change. All other times the value changes. What may be relevant is that on the Page_Load, I also log the value of FileExplorer1.CurrentFolder, if it is a Postback, and saw that the value has since been changed but the visual aspect of the FileExplorer still shows the first Project's folder.
On Page_Load (not a Postback), the Forward, NewFolder and Open are all removed from the ToolBar,ContextMenus[0] and GridContextMenu.
How do I get the FileExplorer to show the contents of the new folder when selecting away from the first Project?
<telerik:RadFileExplorer RenderMode="Lightweight" runat="server" ID="FileExplorer1"
Width="595px" Height="350px" AllowPaging="true" PageSize="10"
VisibleControls="ContextMenus,Grid,Toolbar">
<Configuration EnableAsyncUpload="true"></Configuration>
</telerik:RadFileExplorer>
protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "RowClick")
{
GridDataItem item = (GridDataItem)e.Item;
switch (e.Item.OwnerTableView.Name)
{
case "Missions":
// do something else
break;
case "Projects":
string tempLocation = item["colFullDirectory"].Text;
string newDrive = String.Format("~/aws/{0}", tempLocation.Substring(9));
SetFileExplorerPaths(newDrive);
...
private void SetFileExplorerPaths(string folderPath)
{
string[] paths = new string[]
{
folderPath
};
FileExplorer1.InitialPath = Page.ResolveUrl(folderPath);
FileExplorer1.Configuration.UploadPaths = paths;
FileExplorer1.Configuration.ViewPaths = paths;
FileExplorer1.Configuration.DeletePaths = paths;
}