Back in Chapter 3 when we looked at the Dom utility, we saw the DOM Inspector provided by Firefox (under the heading DOM concepts). DOM viewers are an excellent example of a useful tree-like representation of a series of objects (in that example the objects making up a web page), and the TreeView control can be used to create tree-like structures that are just as useful. File system explorers, such as Windows Explorer or the Finder application on the Mac, are also common examples of tree structures at work.
This component is extremely versatile and provides essential methods for adding and removing nodes programmatically, as well as loading node data dynamically. It also has a set of default behaviors that can be manipulated to give you the effects you want.
It even allows you to override the default behavior of allowing several parent nodes to be expanded at once in order to use the tree control as a navigation menu, and has the capability to...