Data Collection implements the ISupportFiltering interface to support filtering, which enables you to filter data using the FilterAsync method. This method calls the filtering operation and refines the data collection according to the user requirements without including any repetitive or irrelevant data.
IDataCollection provides 5 overloads of FilterAsync method. Refer this topic to know more about these overloads. In the example depicted, we have used FilterAsync<T>(IDataCollection<T>,Expression<Func<T,Object>>,FilterOperation,Object) method overload, which filters the data using specified filter parameters in the DataGridView. The FilterAsync method uses data collection, filterPath, filterOperation and value as its parameters. Here, 'filterPath' refers to the path of the data item to which the filter is applied, 'filterOperation' refers to the specific filter operation and 'value' refers to the value used in the expression.
The GIF below depicts filtering the data grid by Names that begin with 'He' value.
The following code uses the sample created in the Quick Start section. Note that, the filterPath parameter used here is 'Name'. Also, the FilterOperation enumeration uses the StartsWith field to filter all the names that start with 'He'.