This demo illustrates how to filter RadGrid using RadFilter control. For this purpose a few steps must be followed:
- RadFilter's FilterContainerID property must point to a RadGrid instance.
-
AllowFilteringByColumn must be set to true to enable RadGrid filtering
- [optional]IsFilterItemExpanded set to false to hide the built-in RadGrid's filtering item
When bound RadGrid will supply information for all filterable columns to RadFilter that can be used to build filter expressions.
If there are columns with AllowFiltering set to false they will be excluded from the list of the columns that RadFilter will offer to filter.
The filter expressions generated by the RadFilter control will depend on the data type of the source grid fields, thus making them protected from type conflicts and syntax errors.
Note that the filter expressions produced by the built-in filtering mechanism of RadGrid and those created by RadFilter are independent from each other. Hence each of these two filter generators will clear the previous filter patterns applied to RadGrid for ASP.NET AJAX.
The demo also demonstrates how to hide the default Apply button of RadFilter and trigger command for building expressions from an external button handler. The controls are ajaxified via RadAjaxManager.