Class SfFileManager<TValue>
The SfFileManager is a graphical user interface component for managing the file system that allows the users to perform most common file operation like accessing, editing, and sorting the files and folders.
Inheritance
System.Object
Syncfusion.Blazor.SfBaseComponent
SfFileManager<TValue>
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfFileManager<TValue> : SfBaseComponent, IFileManager
Type Parameters
Constructors
SfFileManager()
Declaration
Properties
AjaxSettings
Specifies the AJAX settings of the file manager.
Declaration
public FileManagerAjaxSettings AjaxSettings { get; set; }
Property Value
AllowDragAndDrop
Enables or disables drag-and-drop of files.
Declaration
public bool AllowDragAndDrop { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AllowMultiSelection
Enables or disables the multiple files selection of the file manager.
Declaration
public bool AllowMultiSelection { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Specifies the context menu settings of the file manager.
Declaration
public FileManagerContextMenuSettings ContextMenuSettings { get; set; }
Property Value
CssClass
Specifies the root CSS class of the file manager that allows you to customize the appearance by overriding the styles.
Declaration
public string CssClass { get; set; }
Property Value
Type |
Description |
System.String |
|
DetailsViewSettings
Specifies the details view settings of the file manager.
Declaration
public FileManagerDetailsViewSettings DetailsViewSettings { get; set; }
Property Value
EnableHtmlSanitizer
Defines whether to allow the cross-scripting site or not.
Declaration
public bool EnableHtmlSanitizer { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnablePersistence
Enables or disables persisting component's state between page reloads. If enabled, the following APIs will persist:
View
: Represents the previous view of the file manager.
path
: Represents the previous path of the file manager.
selectedItems
: Represents the previous selected items in the file manager.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
enableRtl
Declaration
public bool enableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Height
Specifies the height of the file manager.
Declaration
public string Height { get; set; }
Property Value
Type |
Description |
System.String |
|
HtmlAttributes
You can add the additional html attributes such as title, native events etc., to the file manager element.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
ID
Specifies the ID value of the file manager element.
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
Type |
Description |
System.String |
|
NavigationPaneSettings
Specifies the navigationpane settings of the file manager.
Declaration
public FileManagerNavigationPaneSettings NavigationPaneSettings { get; set; }
Property Value
Path
Specifies the current path of the file manager.
Declaration
public string Path { get; set; }
Property Value
Type |
Description |
System.String |
|
Specifies the target element in which the file manager's dialog will be displayed.
The default value is null, which refers to the File Manager element.
Declaration
public string PopupTarget { get; set; }
Property Value
Type |
Description |
System.String |
|
RootAliasName
Specifies the root folder alias name in file manager
Declaration
public string RootAliasName { get; set; }
Property Value
Type |
Description |
System.String |
|
SearchSettings
Specifies the search settings of the file manager.
Declaration
public FileManagerSearchSettings SearchSettings { get; set; }
Property Value
SelectedItems
Specifies the selected folders and files name of the file manager.
Declaration
public string[] SelectedItems { get; set; }
Property Value
Type |
Description |
System.String[] |
|
SelectedItemsChanged
Gets or sets a callback of the bound value.
Declaration
public EventCallback<string[]> SelectedItemsChanged { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<System.String[]> |
|
ShowFileExtension
Shows or hides the file extension in file manager.
Declaration
public bool ShowFileExtension { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ShowHiddenItems
Shows or hides the files and folders that are marked as hidden.
Declaration
public bool ShowHiddenItems { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ShowThumbnail
Shows or hides the thumbnail images in largeicons view.
Declaration
public bool ShowThumbnail { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
SortOrder
Specifies a value that indicates whether the folders and files are sorted in the ascending or descending order,
or they are not sorted at all. The available types of sort orders are,
None
- Indicates that the folders and files are not sorted.
Ascending
- Indicates that the folders and files are sorted in the ascending order.
Descending
- Indicates that the folders and files are sorted in the descending order.
Declaration
public SortOrder SortOrder { get; set; }
Property Value
Specifies the group of items aligned horizontally in the toolbar.
Declaration
public FileManagerToolbarSettings ToolbarSettings { get; set; }
Property Value
UploadSettings
Specifies the upload settings for the file manager.
Declaration
public FileManagerUploadSettings UploadSettings { get; set; }
Property Value
View
Specifies the initial view of the file manager.
With the help of this property, initial view can be changed to details or largeicons view. The available views are:
LargeIcons
Details
Declaration
public ViewType View { get; set; }
Property Value
ViewChanged
Gets or sets a callback of the bound value.
Declaration
public EventCallback<ViewType> ViewChanged { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<ViewType> |
|
width
Declaration
public string width { get; set; }
Property Value
Type |
Description |
System.String |
|
Width
Specifies the width of the file manager.
Declaration
public string Width { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder |
__builder |
|
ClearSelection()
Deselects the currently selected folders and files in current path.
Declaration
public Task ClearSelection()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
ClearSelectionAsync()
Deselects the currently selected folders and files in current path.
Declaration
public Task ClearSelectionAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
CreateFolder(String)
Creates a new folder in file manager.
Declaration
public Task CreateFolder(string folderName = null)
Parameters
Type |
Name |
Description |
System.String |
folderName |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
CreateFolderAsync(String)
Creates a new folder in file manager.
Declaration
public Task CreateFolderAsync(string folderName = null)
Parameters
Type |
Name |
Description |
System.String |
folderName |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DeleteFiles(String[])
Deletes the folders or files from the given unique identifiers.
Declaration
public Task DeleteFiles(string[] deleteFiles = null)
Parameters
Type |
Name |
Description |
System.String[] |
deleteFiles |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DeleteFilesAsync(String[])
Deletes the folders or files from the given unique identifiers.
Declaration
public Task DeleteFilesAsync(string[] deleteFiles = null)
Parameters
Type |
Name |
Description |
System.String[] |
deleteFiles |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Disables the specified context menu items in file manager. This method is used only in the menuOpen event.
Declaration
public void DisableMenuItems(string[] menuItems)
Parameters
Type |
Name |
Description |
System.String[] |
menuItems |
|
Disables the specified toolbar items of the file manager.
Declaration
public void DisableToolbarItems(string[] toolbarItems)
Parameters
Type |
Name |
Description |
System.String[] |
toolbarItems |
|
DownloadFiles(String[])
Downloads the folders or files from the given unique identifiers.
Declaration
public Task DownloadFiles(string[] downloadFiles = null)
Parameters
Type |
Name |
Description |
System.String[] |
downloadFiles |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DownloadFilesAsync(String[])
Downloads the folders or files from the given unique identifiers.
Declaration
public Task DownloadFilesAsync(string[] downloadFiles = null)
Parameters
Type |
Name |
Description |
System.String[] |
downloadFiles |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DraggingCall(Double, Double)
Declaration
public Task DraggingCall(double left, double top)
Parameters
Type |
Name |
Description |
System.Double |
left |
|
System.Double |
top |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DragStartCall(Double, Double)
Declaration
public Task DragStartCall(double left, double top)
Parameters
Type |
Name |
Description |
System.Double |
left |
|
System.Double |
top |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
DragStopCall(String, String, String, String, Boolean, Double, Double)
Declaration
public Task DragStopCall(string dragDataId, string dropDataId, string targetModule, string activeModule, bool isLayout, double left, double top)
Parameters
Type |
Name |
Description |
System.String |
dragDataId |
|
System.String |
dropDataId |
|
System.String |
targetModule |
|
System.String |
activeModule |
|
System.Boolean |
isLayout |
|
System.Double |
left |
|
System.Double |
top |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Enables the specified toolbar items of the file manager.
Declaration
public void EnableToolbarItems(string[] toolbarItems)
Parameters
Type |
Name |
Description |
System.String[] |
toolbarItems |
|
FilterFiles(List<TValue>)
Display the custom filtering files in file manager.
Declaration
public Task FilterFiles(List<TValue> filterData = null)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<TValue> |
filterData |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
FilterFilesAsync(List<TValue>)
Display the custom filtering files in file manager.
Declaration
public Task FilterFilesAsync(List<TValue> filterData = null)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<TValue> |
filterData |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Returns the index position of given current context menu item in file manager.
Declaration
public int GetMenuItemIndex(string item)
Parameters
Type |
Name |
Description |
System.String |
item |
|
Returns
Type |
Description |
System.Int32 |
|
GetSelectedFiles()
Gets the details of the selected files in the file manager.
Declaration
public List<TValue> GetSelectedFiles()
Returns
Type |
Description |
System.Collections.Generic.List<TValue> |
|
Returns the index position of given toolbar item in file manager.
Declaration
public int GetToolbarItemIndex(string item)
Parameters
Type |
Name |
Description |
System.String |
item |
|
Returns
Type |
Description |
System.Int32 |
|
OnAfterRenderAsync(Boolean)
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type |
Name |
Description |
System.Boolean |
firstRender |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(System.Boolean)
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Overrides
Syncfusion.Blazor.SfBaseComponent.OnInitializedAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
OpenFile(String)
Opens the corresponding file or folder from the given unique identifier.
Declaration
public Task OpenFile(string file)
Parameters
Type |
Name |
Description |
System.String |
file |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
OpenFileAsync(String)
Opens the corresponding file or folder from the given unique identifier.
Declaration
public Task OpenFileAsync(string file)
Parameters
Type |
Name |
Description |
System.String |
file |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RefreshFiles()
Refreshes the folder files of the file manager.
Declaration
public Task RefreshFiles()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RefreshFilesAsync()
Refreshes the folder files of the file manager.
Declaration
public Task RefreshFilesAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RefreshLayout()
Refreshes the layout of the file manager.
Declaration
public Task RefreshLayout()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RefreshLayoutAsync()
Refreshes the layout of the file manager.
Declaration
public Task RefreshLayoutAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RenameFile(String, String)
Renames the file or folder with given new name in file manager.
Declaration
public Task RenameFile(string renameFile = null, string name = null)
Parameters
Type |
Name |
Description |
System.String |
renameFile |
|
System.String |
name |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
RenameFileAsync(String, String)
Renames the file or folder with given new name in file manager.
Declaration
public Task RenameFileAsync(string renameFile = null, string name = null)
Parameters
Type |
Name |
Description |
System.String |
renameFile |
|
System.String |
name |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SelectAll()
Selects the entire folders and files in current path.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SelectAllAsync()
Selects the entire folders and files in current path.
Declaration
public Task SelectAllAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UploadFiles()
Opens the upload dialog in file manager.
Declaration
public Task UploadFiles()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
UploadFilesAsync()
Opens the upload dialog in file manager.
Declaration
public Task UploadFilesAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Implements