I’ve never used the ListView control before and am trying to programmatically insert items at run-time.
I have a column named Title. And once the user has selected a path from the FolderBrowserDialog. I need to be able to grab all the names of the files inside the SelectedPath and add the names of files as items inside the Title column. Can anybody please help me to do this?
Thank you
I think the best way of doing this would be to use FileInfo as rather than getting the FilePaths just as strings. This way, you can display more information about the file in the ListView if required (say for instance you set the View to detailed, then you could add groups for FileInfo (Size etc.)).
You would do this by adding groups to the list view then adding the items with SubItems:
Obviously you don’t have to use groups and SubItems, this would still work fine without them (just remove the SubItems part).