In the last couple of weeks we have received several requests for a new feature. Imagine that you want to display RadGridView already filtered by a certain criteria. You could always do this in the past by writing something like this:
Now, that is perfectly legal and the grid will come up filtered. The filtering UI however, will not be aware of this. Expressed in other words, this feature might sound like this: “I would like to programmatically achieve the same effect that is achieved by filtering the grid with the mouse/keyboard through the UI.”
This is now possible. You will need to work with a special IFilterDescriptor which is recognizable by our UI. Its name is ColumnFilterDescriptor and it represents what you are already familiar with – the distinct values list and the two filters on the bottom of the filtering UI. In order to create it you will need to pass the column of interest as its constructor’s sole parameter. So for example, if you write something like this:
When the grid is loaded it will display players with a Number less than 10 who are from either England or Spain. Furthermore, when you click on these two columns’ filtering funnels you will see the correct values loaded:
Here is the full source code. You will need to get the Latest Internal Build coming out by the end of the day.
Subscribe to be the first to get our expert-written articles and tutorials for developers!