The tree grid control displays self-referencing lists in a multicolumn tree format. The data is loaded on demand so that large lists can be quickly displayed.
Through a single event handler, a list of items can be used to populate a tree. This population process is done entirely on demand as tree nodes are expanded. The child-item lists can be any IEnumerable collection of objects.
Grid supports accessing a database file to retrieve data items for the tree grid control. With this control, only the RequestTreeItems event needs to be handled and the requested child items for a given parent item need to be provided. For instance, a database may have 100,000 records in it, but these records are only loaded as the user expands nodes. The database is accessed through a typed data set created with the Visual Studio design tools.
The tree grid control now supports multicolumn sorting. You can sort grid data against more than one column by clicking the desired column headers while holding Ctrl. There is also a tri-state sorting mode that will allow the end user to switch between ascending, descending, and unsorted modes on Ctrl+click.
In addition to displaying data from an underlying data source, the tree grid control can display data that is not in an underlying data source via unbound columns. Unbound columns can be used to display expressions that involve manipulating data across columns. These allow custom calculations such as salary and tax calculations. Users can sort unbound columns just like any bound columns.
The look and feel of the tree grid can be enhanced by applying skins. The following images illustrate the built-in skins.
The tree grid control allows you to have different styles specific to each level of a tree.
The tree grid control allows you to time certain aspects of loading and displaying the control. It supports testing scenarios with varying numbers of tree items. The source of the tree data is an in-memory list of employees. The effect of various lookup methods that a person might use can be seen. The image above shows a tree that has 10,000 nodes expanded using an optimized lookup strategy. The time required to expand all the nodes was 0.9917 seconds.
The tree grid control supports XML serialization to preserve and restore a grid’s schema and style settings. All the visual styles, sorting, selection options, and other customization options can be serialized to XML.
You can completely customize the appearance of the tree grid control using Microsoft Expression Blend. The appearance of the header style, cell style, expander style, and row style can be customized using Blend.