Change Theme Settings
Change Theme Settings
Themes
 
Metropolis
Moderno
iOS
Material
Material Compact
Office 365
Mulberry
Show All Themes
v
...v

Custom Filter API

  • Create (F7)Create
  • Rename (F2)Rename
  • Move (F6)Move
  • CopyCopy
  • Delete (Del)Delete
  • RefreshRefresh
  • DownloadDownload
  •  
    ...
 
 
Name 
Date modified 
Size 
Contracts
1/23/2018 9:02:20 AMFolder
Projects
1/23/2018 9:02:20 AMFolder
Reports
1/23/2018 9:02:20 AMFolder
Requests
1/23/2018 9:02:20 AMFolder
Account information.docx
1/23/2018 2:42:25 AM1 B
Bill payment.xlsx
1/23/2018 2:42:02 AM1 B
Design.rtf
1/23/2018 2:42:02 AM1 B
Packing list.xlsx
1/23/2018 2:42:02 AM1 B
Purchase invoice.docx
1/23/2018 2:42:25 AM1 B
Upload

Allowed Extensions: .jpg, .jpeg, .gif, .rtf, .txt, .png, .doc, .docx, .pdf, .xls, .xlsx

The DevExpress ASP.NET File Manager (ASPxFileManager) provides APIs allowing you to filter its file list programmatically in a custom manner. For instance, you can write code to display only certain files types (such as images, spreadsheets or rich text documents) or the most recently used files.

To implement custom filters, manually obtain the required files from your file system provider. Use the following APIs for this purpose.

  • The ASPxFileManager.FileListCustomFilter property.
    Specify the name of your custom filter to be currently applied to the File Manager's file list. Use this property to identify the active filter among all named custom filters you implement.
  • The ASPxFileManager.FileListCustomFilterBreadcrumbsText property.
    Optionally, specify the breadcrumbs text to be displayed in the File Manager for the applied filter.
  • The FileSystemProviderBase.GetFilteredItems method.
    Override this method within your file system provider to offer implementations of all custom filters to be used in the File Manager. This method has a parameter of the FileManagerGetFilteredItemsArgs type whose properties allow you to identify the filter, determine its additional characteristics and return file items matching the filter.
  • The FileManagerGetFilteredItemsArgs object's properties:

    • FileListCustomFilter - Gets the active filter's name (specified by the File Manager's FileListCustomFilter property).
    • FilterBoxText - Gets the search string entered into the File Manager's filter box.
    • Folder - Gets the File Manager's currently active folder.
    • Items - Specifies a collection of file items (FileManagerFile or FileManagerFolder instances) that match the applied filter.

This demo illustrates how to implement custom filters - in the demo they are 'Recent', 'RTF Docs', 'Sheets', 'Images', 'PDFs', and 'Favorites'. They allow end-users to filter the File Manager's file list by a certain criterion and to search within the applied filter using the filter box.

Note that in this demo, custom filters' UI is implemented using the ASPxMenu that is displayed instead of the File Manager's folder list view. Each menu item identifies the corresponding custom filter by its name. Clicks on menu items are processed on the client side to initiate the File Manager's custom callback passing the clicked item's name to the server (through the PerformCallback client-side method). On the server side, in the File Manager's CustomCallback event handler, this name (identifying the filter to apply) is assigned to the File Manager's ASPxFileManager.FileListCustomFilter property. Implementation of individual custom filters is given in the CustomFileSystemProvider class that inherits functionality from the standard PhysicalFileSystemProvider and overrides the FileSystemProviderBase.GetFilteredItems method.