Click here to Skip to main content
13,194,231 members (50,951 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 3 May 2012

File and Folder ListView

, 4 May 2012
Rate this:
Please Sign up or sign in to vote.
File and Folder Listview is a simple component that I made as an alternative to OpenFileDialog or CommonOpenFileDialog that does not support selecting both File or Folder.



File and Folder Listview is a simple component that I made as an alternative to OpenFileDialog or CommonOpenFileDialog that does not support selecting both File or Folder.

In the standard controls, we use OpenFileDialog to select Files and we use FolderDialog to select Folders. Other common controls released by Microsoft was the CommonOpenFileDialog available in WindowsAPICodePack. The UI looks like the standard OpenFileDialog but it can also select Folders if "IsFolderPicker" property is set to true. But one thing these standard controls cannot do is to the ability to select both File or Folder 

Using the code

In your project, add FileFolderList.cs and drag the control in your form or in any container. FileFolderList is using ListView as it's base class so all the properties, method, and events of the ListView are available.

FileFolderList has 3 custom properties

  • string DefaultPath {get;set;}
  • string SelectedPath {get;}
  • bool isSoloBrowser {get;set;}
    // - when true, it will add "..." so you can go back to the parent folder

and 2 custom methods

  • void Load()
    call this method when your form has loaded 
  • void Browse(string path)  

Adding the control programatically can be done in this way

GCS.Windows.Forms.FileFolderList ffl = new GCS.Windows.Forms.FileFolderList();
ffl.View = View.Details;
ffl.Dock = DockStyle.Fill;

Points of Interest

FileFolderList uses BackgroundWorker object to load the associated icons in a separate thread. 


this is my initial release 


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


About the Author

Jayson Ragasa
Founder Capploud
Philippines Philippines
I am an experienced Applications Developer and had worked professionally for over 6 years. I have been writing codes and building different applications for over 13+ years. My work is mostly for Microsoft technologies such as .NET. Yes I am Microsoft technology enthusiast.

My field of expertise in .NET technology are Desktop and Windows Mobile and Windows Phone. I occasionally write ASP.NET too for clients.

I have wide experience of different programming languages and scripts such as: Turbo Pascal, Batch Scripts, C/C++, Visual Basic Classic, Visual Basic .NET, Java, HTML, CSS, ASP Classic, VB Script, ASP.NET, T-SQL, MySQL, PHP, C#, Javascript, jQuery, HTML5, RegEx, XAML, XML, JSON, and XPath

I am also experienced in different platforms such as: Google Data API, Google Map API, Twitter API, Facebook API, Flickr API, Skydrive API, SVN, GitHub, Drupal, and Orchard.

I am interested in Microsoft technologies, User Experience and User Interfaces, Algorithms, Robotics, Astronomy, Architecture, Electrical, Mechanics, and Extra Therestrial Life on other planets.

I am also offering free coding and application development consultations with students having a problem with their Thesis projects.

View my full Curriculum Vitae here

You may also be interested in...


Comments and Discussions

QuestionI don't see where IsFolderPicker exists Pin
David Fenstemaker19-Aug-16 7:54
memberDavid Fenstemaker19-Aug-16 7:54 
Questionset path Pin
Gabee810-Oct-14 1:58
memberGabee810-Oct-14 1:58 
GeneralMy vote of 5 Pin
treesprite18-Jul-14 14:33
membertreesprite18-Jul-14 14:33 
QuestionFiltering Suggestion? Pin
treesprite18-Jul-14 14:30
membertreesprite18-Jul-14 14:30 
GeneralMy vote of 3 Pin
vaivit24-Jun-14 21:16
membervaivit24-Jun-14 21:16 
Questionimplement a save function... Pin
treesprite6-Feb-13 12:24
membertreesprite6-Feb-13 12:24 

modified 12-Feb-13 12:47pm.

AnswerRe: implement a save function... Pin
Jayson Ragasa6-Feb-13 12:26
memberJayson Ragasa6-Feb-13 12:26 
QuestionImages Pin
Mehdi Gholam3-May-12 19:24
mvpMehdi Gholam3-May-12 19:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171018.2 | Last Updated 4 May 2012
Article Copyright 2012 by Jayson Ragasa
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid