Skip to Main Content
Windows Presentation Foundation 4.5 Cookbook
book

Windows Presentation Foundation 4.5 Cookbook

by Pavel Yosifovich
September 2012
Intermediate to advanced content levelIntermediate to advanced
464 pages
10h 55m
English
Packt Publishing
Content preview from Windows Presentation Foundation 4.5 Cookbook

Sorting and filtering bound collections

Data templates provide a powerful way to present data using text, images, and anything else WPF is capable of. Often, we need to present the data in some order, typically sorted by some property (or properties). Sometimes we don't want to show all data, but a part of it, such as when a user searches for something and we want to show the result of the search, which maybe just a subset of the original data.

One way to go about it is to operate on the data itself. We can certainly apply sorting on lists (List<T>.Sort, Array.Sort, and so on), as well as filtering (List<T>.FindAll), and by using Language Integrated Query (LINQ) it's even easier (and more versatile) to sort (orderby clause) and/or filter (where ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Presentation Foundation Development Cookbook

Windows Presentation Foundation Development Cookbook

Kunal Chowdhury

Publisher Resources

ISBN: 9781849686228Supplemental Content