FileManager Data Binding to Hierarchical Data
This article explains how to bind the FileManager for Blazor to hierarchical data. Before continuing, make sure you are familiar with the FileManager data binding basics.
Hierarchical data means that the collection of child items is provided in a field of its parent's model:
-
The
Itemsfield contains a collection of all children including sub-folders and files. They will be rendered in the FileManager View when the parent folder is selected. -
The
Directoriesfield contains a collection of the subfolders of a directory. They will be rendered in the TreeView navigation pane. If there areDirectoriesfor a specific folder it will have an expand icon. TheHasDirectoriesfield can override this, however, but it is not required for hierarchical data binding.
This approach of providing items lets you gather separate collections of data that may even come from different sources.
Example of hierarchical data binding