Lists, Trees, Toolbars, and Menus

So far, you've learned a wide range of techniques and tricks for using WPF data binding to display information in the form you need. Along the way, you've seen many examples that revolve around the lowly ListBox control.

Thanks to the extensibility provided by styles, data templates, and control templates, even the ListBox (and it's similarly equipped sibling, the ComboBox) can serve as remarkably powerful tools for displaying data in a variety of ways. However, some types of data presentation would be difficult to implement with the ListBox alone. Two important examples include the following:

  • Showing a tabular grid of information

  • Showing a hierarchical tree of information

Although you could build these controls ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.