Skip to main content
A newer version of this page is available. .
Tab

ASPxFileManager.SelectedFolder Property

Gets the currently selected folder in the folder container.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

public FileManagerFolder SelectedFolder { get; }

Property Value

Type Description
FileManagerFolder

A FileManagerFolder object that is the selected folder.

Remarks

Use the SelectedFolder property to get the currently selected folder in the folder container. Note that only one folder can be selected in the folder container at the same time. You can customize the appearance of the selected folder, using the folder’s FileManagerFolderStyle.SelectionActiveStyle and FileManagerFolderStyle.SelectionInactiveStyle properties, or common for files and folders, the FileManagerItemStyle.SelectionActiveStyle and FileManagerItemStyle.SelectionInactiveStyle properties.

ASPxFileManager - FolderContainer

Example

The code below demonstrates how you can show information about folder contents in a label.

public string ItemsNumberToString(int count, string item) {
        if (count != 1) item = item + "s";
        return count.ToString() + " " + item;
}
protected void ASPxFileManager1_Load(object sender, EventArgs e) {
        int FileCount = ASPxFileManager1.SelectedFolder.GetFiles().Length;
        int FolderCount = ASPxFileManager1.SelectedFolder.GetFolders().Length;
        ASPxFileManager1.JSProperties["cpLabelText"] = "The " + ASPxFileManager1.SelectedFolder.Name + " folder contains " + ItemsNumberToString(FolderCount, "folder") + " and " + ItemsNumberToString(FileCount, "file");
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectedFolder property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also