Skip to main content

ASPxClientFileManager.SetCurrentFolderPath(path, onCallback) Method

Sets the current folder’s path.

Declaration

SetCurrentFolderPath(
    path: string,
    onCallback: ASPxClientFileManagerCallback
): void

Parameters

Name Type Description
path string

A String value that is the relative path to the folder (without the root folder).

onCallback ASPxClientFileManagerCallback

A ASPxClientFileManagerCallback object that is the JavaScript function that receives the callback data as a parameter.

Remarks

Use the SetCurrentFolderPath method to set the path to the current folder. The onCallback parameter is optional. The function specified via this parameter is called after the current folder is changed.

To set the root folder, call the method with the empty path parameter value.

Example

The code sample below demonstrates how to set the current folder on the client side using the SetCurrentFolderPath method. Note that the Report button selects the first file in the specified folder as well.

<script>
  function SelectFirstFile() {
     myFileManager.GetItems()[0].SetSelected('true');
  }
</script>

<dx:ASPxButton ID="Root" runat="server" Text="Root" AutoPostBack="False">
  <ClientSideEvents Click="function(s, e) {myFileManager.SetCurrentFolderPath('')}" />
</dx:ASPxButton>

<dx:ASPxButton ID="Reports" runat="server" Text="Reports" AutoPostBack="False">
  <ClientSideEvents Click="function(s, e) {myFileManager.SetCurrentFolderPath('Documents/Reports',SelectFirstFile)}" />
</dx:ASPxButton>

<dx:ASPxButton ID="TestProjects" runat="server" Text="Test Project" AutoPostBack="False">
  <ClientSideEvents Click="function(s, e) {myFileManager.SetCurrentFolderPath('Documents/Projects/Test project')}" />
</dx:ASPxButton>

<dx:ASPxFileManager ID="ASPxFileManager1" runat="server" ClientInstanceName="myFileManager">
   <Settings RootFolder="~\Content\Files" ThumbnailFolder="~\Thumb\" />
</dx:ASPxFileManager>
See Also