That is called filtering and is possible of course. If you have a RadGridView or RadDataFilter bound to your data source control then filtering will occur out-of-the-box when the user filters through the UI. No code needed.
In case you want to filter programmatically, you can add a FilterDescriptor
instance to the FilterDescriptors collection of the control. For example:
this.radEntityFrameworkDataSource.FilterDescriptors.Add(new FilterDescriptor("IsDeleted", FilterOperator.IsEqualTo, false));
This will automatically append a Where clause on the query and send it to the server.
You can create more complex filtering criteria by combining them with CompositeFilterDescriptor
The same applies for sorting
. For example, if you sort RadGridView, this will automatically be transferred to the server by appending an OrderBy clause on the query. Grouping will append a GroupBy clasue.
You can bind a RadDataPager to the data source control and you will get paging out-of-the-box as well. It will apppend Skip and Take clauses.
All of this happens without a single line of code.
I have attached a sample project which you can play around it and test this functionality. You might need to point the connection string to your local instance of AdventureWorks.
Let me know if I can help with anything else.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>