Is there any way to load the data in the FileManager control virtually. I would prefer to not have to traverse the entire file system to provide the folder/file structure. Can the OnRead method be used to provide just the data needed for the current view?
Thank You,
-Andy
1 Answer, 1 is accepted
0
Stamo Gochev
Telerik team
answered on 25 May 2022, 05:29 AM
Hello,
The "OnRead" handler can be used for achieving a final result similar to virtual loading. Another approach is to change the "Data" collection on some actions like when the "PathChanged" event is triggered (e.g. navigation). In general, the FileManager does not need to load all the data as it only displays a view for a certain folder only and a particular level for the treeview, thus you can limit the data in such a way that suits your needs.
If you are looking for a specific way of virtualization (e.g. virtualizing the navigation treeview separately from the list/grid), can you elaborate more on the expected final result? Is there a demo (even from a 3rd-party source) that you can show, where I can check out the expected behavior? You can also send a REPL example with your current configuration if the above is not possible, so I can have a look at what is not working and make further suggestions.
Regards,
Stamo Gochev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
We also have same requirement. We want to show child files when user clicks on folder. Can you provide sample code to implement PathChanged event you mentioned above?
Stamo Gochev
Telerik team
commented on 23 Sep 2022, 07:36 AM
The main idea behind using the "PathChanged" event is to get a hook for when a new folder is selected (clicked) and set new data to the "Data" parameter of the FileManager. Here is a sample snippet that illustrates this:
The "ProcessData" method is expected to contain a custom implementation of how the new data is obtained based on the changed file path. Note that this implementation is dependent on whether hierarchical or flat data binding is used, so I cannot provide a generic example. In addition, the concrete code might depend on other factors (e.g. how you operate with the file system), but you can try the concept and adapt it to your specific needs.