Tuesday, September 30, 2008

Telerik Watch Minute: Enhancing RadGrid filtering

After the busy "news update" TWM last week, this week I decided to bring you an episode dedicated to cool Telerik coding tip. Specifically, in this episode I show you how you can easily use the client-side API of RadGrid for ASP.NET AJAX to enable complete keyboard control over all filtering operations. You can change filtering functions and filter the grid without ever touching the mouse! It's a simple tweak you can easily add to any RadGrid to give your "power users" the ability to be more productive. Enjoy! Download the code NOTE: You'll need the AdventureWorks DB to run the demo Click here to watch video full size (for better viewing of code)

1 comments:

Anonymous said...

System.Web.HttpRequestValidationException will occur for < signs.
To correct this, in the js code, add:
sender.value = query;
before:
tableView.filter(col, query, filter);

Also, 2009 Q3 build 1103 has a bug - it compares typeof (filterFunction) to "Number" instead of "number" which causes it to parse the filter ordinal value as a string and get an error.

This can be fixed by changing all of the oridnals to strings. filter converts the strings.
e.g. Instead of:
filter = Telerik.Web.UI.GridFilterFunction.Contains;
Change to:
filter = "Contains";