Click here to Skip to main content
15,844,903 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
Hi, I have an application that is made up of numerous controls. One of these controls 'BrowseFilesUsrCtrl.ascx' displays with a treeview (displaying all folders/files on the directory) on the left hand side with a preview pane on the right which displays the contents of certain files for read only purposes. A requirement has been raised to alter this screen so it acts like a window explorer session i.e. treeview on the left that displays only folder items and if a folder is selected I'd like to show a detailed summary for any files contained in this folder in the right hand pane i.e. Name, Size, Type, Date Modified with the ability to open any selected file to view the contents.

Without the need to purchase a 3rd party control is there any way I can do this? A nudge in the right direction would be appreciated.

Updated 17-Mar-16 9:04am

1 solution

You can do it all using the System.IO Classes in the .NET Framework.

Upon click on directory name in the left preview pane, use System.IO.FileInfo class to retrieve details of each file found via the Directory.EnumerateFiles method.

Some examples that you can learn from:
How does EnumerateFiles() work?[^]

How to use DirectoryInfo.EnumerateFiles[^]

How to: Enumerate Directories and Files[^]

Sample Program:
File System Tree View[^]
Share this answer
pmcm 25-Apr-13 4:05am    
Have you an example of how this is implemented?
pmcm 25-Apr-13 5:35am    
I think I am going to go down the route of developing an expandable datagrid so I can make use of the multiple columns whilst still keeping the right sided pane for previewing the contents

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900