The solution for this was not totally obvious to me when reading the RadGrid documentation, so I did a bit of forum searching and found the solution below:
Let’s say you’ve got a RadGrid on your page, and you’ve configured it already to allow for filtering by setting the AllowFilteringByColumn property to true as follows:
1 | <radG:RadGrid ID="rgDistricts" runat="server" PageSize="5" Skin="Default" AllowFilteringByColumn="true" AllowPaging="True" AllowSorting="True" GridLines="None" AutoGenerateColumns="False" OnDeleteCommand="DistrictDelete" OnItemCommand="ItemClick" OnNeedDataSource="District_NeedDataSource"> |
The code above will insert filter boxes and a filter menu into your grid which will allow users to enter a value and select a filter funtion to filter the grid. This works good except it requires that a user enter a value and then use the mouse to select how they want to filter on that value before the grid is affected.
It would be faster and a better user experience to allow users to enter a value and then hit the enter key and then have the grid filter. So to achieve this, you have to tell each of your bound columns that a. you want to auto post back on filter and b. what default filter funtion to use as follows:
1 | <radG:GridBoundColumn DataField="Address" SortExpression="Address" HeaderText="Address" UniqueName="Address" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"> </radG:GridBoundColumn> |
