Dynamically load file directory into TreeNavigator?

Good day,

I have been toying with creating a custom "File Explorer" like control embedded in my application. I took a look at the Tree Navigator, which appears to be designed to manually assign the tree nodes, however, I really like the UI aspect of this control and I think it would make a great and unique file explorer alternative if it is possible to pass a drive (i.e. C:) and all of its subfolders into this control. Is such a thing possible?

Thanks!

5 Replies

KJ Keerthana Jegannathan Syncfusion Team January 23, 2018 11:00 AM UTC

Hi Travis, 
 
Thank you for contacting Syncfusion support. 
 
We understand that your requirement is to load the directories present in your machine to create the file explorer structure using TreeNavigator control. If so, we have prepared a sample for your requirement in which we have loaded the directories in the TreeNavigator and it can be downloaded from the below location. 
 
 
Please check with the sample and let us know whether it helps to achieve your requirement. 
 
Regards, 
Keerthana J 



TC Travis Chambers January 23, 2018 03:45 PM UTC

Thank you very much for this sample! It looks great. That being said, I can't for the life of me figure out how to dive deeper into each drive. The sample only goes one step into each drive. Is there a logical way to set nodes all the way through each file tree?


PB Priyanga Balasubramaniam Syncfusion Team January 29, 2018 12:56 PM UTC

Hi Travis,

Thank you for the update.

We have modified our sample to achieve your requirement. In this sample, in “TreenavigatorItemsUpdate” method fetched the sub folders of current selected folder added those sub folder as items to the current SelectedItem(Folder).

Please download the sample from the below location.

Regards,
Priyanga B



TC Travis Chambers February 16, 2018 02:23 PM UTC

Thank you for your example, however it still has the same issue as you can only drill down into the first file level. I think instead I will look into exploring the typical tree view. I liked the idea of creating a file explorer control using the unique ui of this control, but the tree view will offer the functionality I need I think.

Thanks!


VR Vijayalakshmi Roopkumar Syncfusion Team February 19, 2018 12:19 PM UTC

Hi Travis,

Thank you for the update.

As SfTreeNavigatorItem can display with String values, we could not display the file types like image, notepad etc., Due to this reason we have provided sample which display until folder. Also we suggest you to display the other file types in separate panel based on TreeNavigationItem selected item.

Regards
Vijayalakshmi V.R.

Loader.
Up arrow icon