Sunday, 13 July 2014

How to disable expanding in certain branches in TreeView (WinForms) ?



What I'm trying to implement:


I want to visualize a content of certain folder (all subfolders and files) via TreeView. And when a user clicks on file or folder in the tree - he gets the extended info (such as: size, creation date etc.) Btw, I populate my TreeView from XML-file.


Look at the screenshot.


enter image description here


When I make it like on the 1st picture - I can handle a user's click, read child nodes and display the extended file info. BUT this version of tree is too bulky.


The 2nd version of tree is much better looking. BUT in this case - I can't easily reach file info (size, name etc.) that I want to output to user.


So I need your advise, how to solve my problem.


All that comes to my mind: disable expansion of nodes ; make some sort of hidden fields. But I don't know how to implement it :(


No comments:

Post a Comment