TreeView and ListView

The world is very confusing, with information everywheresome related, some not. To survive, Homo sapiens have learned to organize: it is a survival trait. Two primary organization tools in .NET applications are lists and tree controls.

The essential character of a list is that it is linear, without branches or levels. The list can contain all the objects in a group or a subset, filtered according to an appropriate algorithm. It can be sorted: alphabetically, or by cost, color, or any number of other parameters, or not at all.

An alternative, and complementary, way to organize and classify is hierarchically. A hierarchical organization is comprised of parent/child relationships. Each object is at a specific level in the hierarchy, and each object can have a parent object, a child object, neither, or both. The best way to represent hierarchical organizations is with a tree structure, often drawn upside down, as shown in Figure 14-1.

Figure 14-1. Tree structure

figs/pnwa_1401.gif

The stereotypical, and most visible, use of list and tree controls in the Windows world is Windows Explorer, the file and directory management program that has been included with Windows since Windows 95. Files and directories (folders in the new parlance) lend themselves well to this blend of hierarchical and ListViews. Explorer uses a tree view control on the left to show the hierarchical nature of the directory tree structure, and a ListView on the right to show all the files and directories contained within a specific directory. The two main controls are separated by a splitter control to allow complementary resizing of the two adjacent controls.

In this chapter, you will learn about the classes provided by the .NET Framework to implement list and tree structures as part of the Windows Forms user interface. The next chapter will cover members of the ListControl class, including the ListBox, CheckedListBox, and ComboBox.

Windows Forms and the .NET Framework

Getting Started

Visual Studio .NET

Events

Windows Forms

Dialog Boxes

Controls: The Base Class

Mouse Interaction

Text and Fonts

Drawing and GDI+

Labels and Buttons

Text Controls

Other Basic Controls

TreeView and ListView

List Controls

Date and Time Controls

Custom Controls

Menus and Bars

ADO.NET

Updating ADO.NET

Exceptions and Debugging

Configuration and Deployment



Programming. NET Windows Applications
Programming .Net Windows Applications
ISBN: 0596003218
EAN: 2147483647
Year: 2003
Pages: 148

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net