Hi I am trying to change FileExplorer path dynamically but its not getting change. I have one dropdown box and based on selected item I am trying to change the File Explorer path Dynamically. Please see my code below:
<
div
class
=
"settings"
>
<
h1
>Media Libraries</
h1
>
<
div
>
<
fieldset
style
=
"width: 250px;"
>
<
legend
>Choose a Site</
legend
>
<
telerik:RadComboBox
ID
=
"ddlSite"
runat
=
"server"
Width
=
"200px"
Height
=
"100px"
AutoPostBack
=
"true"
EmptyMessage
=
"Select a Site"
EnableVirtualScrolling
=
"true"
OnSelectedIndexChanged
=
"ddlSite_SelectedIndexChanged"
>
</
telerik:RadComboBox
>
</
fieldset
>
</
div
>
<
div
>
<
fieldset
style
=
"width: 250px;"
>
<
legend
>Selected Site</
legend
>
<
asp:Label
ID
=
"lblSiteName"
runat
=
"server"
Text
=
""
></
asp:Label
>
</
fieldset
>
</
div
>
</
div
>
<
table
cellspacing
=
"4"
cellpadding
=
"0"
border
=
"0"
style
=
"padding-left:10px;"
>
<
tr
>
<
td
style
=
"vertical-align: top;"
>
<
telerik:RadFileExplorer
runat
=
"server"
ID
=
"FileExplorer1"
Width
=
"1000px"
Height
=
"500px"
OnClientItemSelected
=
"OnClientItemSelected"
>
</
telerik:RadFileExplorer
>
</
td
>
<
td
valign
=
"top"
>
<
fieldset
style
=
"width: 230px; height: 220px"
>
<
legend
>Preview</
legend
>
<
img
id
=
"pvwImage"
src
=
""
runat
=
"server"
alt
=
""
style
=
"display: none; max-width:230px; max-height:220px; margin: 10px; vertical-align: middle;"
/>
</
fieldset
>
</
td
>
</
tr
>
</
table
>
.cs page:
protected void Page_Load(object sender, EventArgs e)
{
InitializeContainer();
//set properties according to configuration panel
FileExplorer1.VisibleControls = GetVisibleControls();
FileExplorer1.EnableOpenFile = true;
FileExplorer1.DisplayUpFolderItem = true;
FileExplorer1.AllowPaging = true;
FileExplorer1.EnableCreateNewFolder = true;
FileExplorer1.Upload.Enabled = true;
//if (!enableUpload.Checked)
//{
// FileExplorer1.Configuration.UploadPaths = new string[0];
//}
if (!IsPostBack)
{
BindSite();
lblSiteName.Text = ddlSite.SelectedItem.Text;
////Set initial folder to open. Note that the path is case sensitive!
FileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomColumnsContentProvider).AssemblyQualifiedName;
//FileExplorer1.InitialPath = Page.ResolveUrl(String.Format("~/SiteData/{0}/UserFiles/allowed.png",this.SiteID));
this.SiteID = Convert.ToInt32(ddlSite.SelectedValue);
string PagePath = Page.ResolveUrl(String.Format("~/SiteData/{0}/UserFiles/allowed.png", this.SiteID));
string RootPagePath = Page.ResolveUrl(String.Format("~/SiteData/{0}/UserFiles", this.SiteID));
//Set initial folder to open. Note that the path is case sensitive!
// FileExplorer1.InitialPath = PagePath;
FileExplorer1.Configuration.ViewPaths = new string[] { RootPagePath };
FileExplorer1.Configuration.UploadPaths = new string[] { RootPagePath };
FileExplorer1.Configuration.DeletePaths = new string[] { RootPagePath };
}
AddDateAndTypeColumns();
}
protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e)
{
lblSiteName.Text = ddlSite.SelectedItem.Text;
this.SiteID = Convert.ToInt32(ddlSite.SelectedValue);
string RootPagePath = Page.ResolveUrl(String.Format("~/SiteData/{0}/UserFiles", this.SiteID));
//Set initial folder to open. Note that the path is case sensitive!
// FileExplorer1.InitialPath = PagePath;
FileExplorer1.Configuration.ViewPaths = new string[] { RootPagePath };
FileExplorer1.Configuration.UploadPaths = new string[] { RootPagePath };
FileExplorer1.Configuration.DeletePaths = new string[] { RootPagePath };
}
Thanks in advance for your help....