Q3 2011 is knocking on the door and along with all the cool stuff you will find inside, there is one feature that we would like to tell you about now. Do you remember Excel-Like functionality, which allows the end-user to effortlessly apply filter by selecting items from a popup list? Now we are including a bunch of new stuff to it.
Calendar filter popup First of all is a new calendar popup. It will be shown by default for date columns, and it will allow for easily selecting a date from RadCalendar. For additional convenience, there are a couple of predefined options to choose from:
But hey, that is not all. You can entirely customize all these predefined options. Here is the time to reveal another new feature: a new RadGridView event called FilterPopupRequired, which will allow you to access the popup, modify it or even use a custom popup.
Getting back to the date filter, there are three methods, which can be used to modify the items: AddCustomMenuItem, RemoveCustomMenuItem and ClearCustomMenuItems. An example of how to use them can be found below:
sender, FilterPopupRequiredEventArgs e)
RadDateFilterPopup popup = (RadDateFilterPopup)e.FilterPopup;
"IsLessThanOrEqualTo - 15.08.1996"
DateTime(1996, 8, 15)));
DateTime(2011, 10, 20)));
And here is the result:
Simple list filter popup Another new feature is the simple list filter popup. Sometimes, there is a need to apply a simple filter with just one click. Here this new popup class comes in handy. It offers a list of values and one-click filtering functionality.
Again, you can use FilterPopupRequired event to set it to a column of your choice:
Grouped Date Filter Popup Probably, you have already noticed that there is some room for improvement in the way the filtering list represents a lot of date values. The new functionality addresses this task - it shows dates grouped by year and month, thus allowing for easily applying the filtering criteria:
To employ this list, handle the FilterPopupRequired event and use the RadListFilterPopup’s constructor with two parameters:
Custom Filter Popup Last, but not least, if the enhancements introduced above are not enough to cover your requirements, then there is a way to create a custom filter popup object and use it along with your own filtering logic. The only requirement is that your filter popup should implement IGridFilterPopup. An instance of your custom popup can be assigned in the FilterPopupRequired event handler, as this is done with the built-in popups.
We hope that you will like the new enhancements. Happy coding!
Nikolay Diyanov is the Product Manager of Telerik's UI for iOS and UI for Xamarin divisions. He joined the company back in 2007 as a Support Officer and made his way up the ladder over the past few years. Delivering outstanding solutions that make developers lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.
Find him on Twitter @n_diyanov or on LinkedIn.
Copyright © 2016, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.