.Net Grid tutorial (Part5: Data filtering)

Data filtering actually controls visibility of individual grid rows basing on rules set by the programmer. These rules should be convenient and easy to use, should not depend on data sorting or grouping and should be equally applied to static and real-time data. Data filtering should not depend on hierarchy level or on data being expanded or collapsed by parent rows.

The grid provides three complementary methods of data filtering.

Combined use of visual filters and a filter set via Grid.Filter property.

The grid supports combined operation of such filters basing on AND principle. If any of the filters instructs the grid to hide a row, this row becomes invisible. In event-driven model, if data objects implement INoifyPropertyChanged interface or are located in IBindingList collection, the grid receives notifications from these interfaces and checks visibility of rows that display changing data.

It's also worth mentioning that data can also be sorted or grouped by one or several columns. The grid fully hides the complexity of data filtering implementation. For example, let's look at grouped data. Each group can contain one or more visible rows. If all rows in a group become hidden, the group itself also becomes invisible, which is hard to achieve by manual data filtering. When event-driven model is used, filtering becomes a trivial task for the programmer, and therefore the programmer can concentrate on more important aspects of the application.