This is a migrated thread and some comments may be shown as answers.

Filtering at the sql server using the RadGridView filter UI?

4 Answers 266 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JC
Top achievements
Rank 1
JC asked on 29 Oct 2011, 12:24 AM
I'm working with very large databases and filtering (and sorting) at the database server.  I'm using the RadGridView filtering and sorting but catching the events and triggering a requery at the database server after gathering the users filter and sort choices and converting them to SQL.

So far so good however I ran into a problem:
When a new filter is created I catch that in the grid's Filtered event and examine for distinct filters and field value filters and build accordingly.  The problem comes when a user *removes* the filter from a column as there is no event fired that I can see so there's no way I know of to trigger another query.

Ideally I wish the GridView just had an event that indicated it needed a refresh of it's data when a user filters or sorts or changes column order etc to support people like me who are not going to simply send a gigabyte of data directly to the grid to allow it to do the sorting and filtering itself.  That way I could just iterate the columns build my sort and filter all at once in one go and be done with it.

This doesn't appear to be supported however or I missed something (which seems likely, because who builds a grid with no support for filtering and sorting at the back end?) so if my approach is wrong I'd love to hear about it.  If not then how do I determine when the user has *removed* a filter from a column?

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Oct 2011, 08:00 AM
Hi,

 Why not bind the grid to some LINQ context? All these (sorting, filtering, grouping, etc.) will be applied on the data base server automatically. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
JC
Top achievements
Rank 1
answered on 31 Oct 2011, 06:40 PM
Hi Vlad, I'm not using LINQ to SQL. I have a large and complex business object framework behind the scenes.

Perhaps I'm misunderstanding your suggestion but LINQ to SQL is deprecated and dead at this point.  Are you referring to some other technology?
0
Vlad
Telerik team
answered on 01 Nov 2011, 08:19 AM
Hello,

 I'm not referring to LINQ to SQL. I'm referring to any LINQ provider including Telerik Open Access, Microsoft Entity Framework, etc.

Best wishes,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
JC
Top achievements
Rank 1
answered on 01 Nov 2011, 05:35 PM

Sorry Vlad, I didn't think I would need to write out the whole back story to get an answer on what seems simple to me but I guess I'm working outside the box Telerik envisioned for the wpf grid so I'll take a shot at it.

Here's the back story:

I'm porting an existing commercial app from Winforms / asp.net to WPF / HTML 5 (MVVM) UI's.  It has a business object library based on the CSLA.NET business object framework: http://www.lhotka.net/cslanet/faq/Getting%20started.ashx 

I have ported my business object library to the latest version of CSLA 4.2

I'm now working on the WPF interface.  I have list objects that can potentially return gigabytes of data in theory and many existing users with many years of data.  My business objects for lists take a custom fragment of xml that reflects the user's filtering, sorting,  column ordering and paging values in the grid and so I normally have code that extends a grid control and converts the user's filtering and sorting and column order and page choices into the format the business list objects understand.

I wrote a custom system so that I could support any vendor's grid products in that version both asp.net Telerik grid (with lot's of customization) and the Infragistics winform grid originally in the old version.

Now I need to replicate this with the Telerik WPF grid.  I can not simply bind it directly to the business object library, I need to interpret what the user chooses in sorting and filtering and grid order and recreate my custom XML fragment to pass to the business object and get the next page or changed criteria etc.

I am not using LINQ to anything, no LINQ at all anywhere or entitify framework or anything else between my business objects and the sql server because performance is simply not adequate.

I'm also going to be making an html 5 UI to replace the old UI, not sure where I"m going grid-wise for that yet but obviously it's still important to keep my custom independent method of doing business object lists since the grid could be anything.

This is what I'm dealing with.

Any suggestions welcome.  So far the only sticking point is that the grid doesn't tell me when a user *removes* a filter, there is no event triggered for it that I can tell.

The latest thing I've come across in my research is the Telerik VirtualQueryableCollectionView which sounds like it might be something I can leverage events from possibly to support my business objects.  Unfortunately it doesn't seem to be documented very well anywhere for this kind of purpose.  Is this a possibility? Is there any docs on using the VirtualQueryableCollectionView with custom back end system?

Any other ideas?  Ways to find out if the grid has a filter removed?

Tags
GridView
Asked by
JC
Top achievements
Rank 1
Answers by
Vlad
Telerik team
JC
Top achievements
Rank 1
Share this question
or