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

Use the RadGrid Filter in my own SQL

4 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin Warnke
Top achievements
Rank 1
Kevin Warnke asked on 21 Jul 2010, 03:01 AM
I have a custom DB layer that accepts a "where" clause as part of retrieving a collection of a specific type that my page needs for existing processing.

I'd like to be able to use the filters in the RadGrid to manipulate my SQL to generate the contents of the "where" clause (rather than having a separate section on the page that would contain the filter inputs).

Is this possible?

I found the column.EvaluteFilterExpression() which returns the info I'm looking for but in a format that would be difficult to manipulate.

At this point I'd even be okay with just getting the TEXT that was entered into the filter box and forcing everyone to use contains if that's the only way to get this done.

Thanks!
Kevin

4 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 23 Jul 2010, 09:47 AM
Hello Kevin,

Try setting the EnableLinqExpressions property of the grid to false and then take the FilterExpression from the MasterTableView - it should be in a sql format when linq expressions are disabled.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kevin Warnke
Top achievements
Rank 1
answered on 23 Jul 2010, 10:44 PM
That was it, thanks!

I still have to manipulate the results when the property name doesn't match the SQL field but at least this representation is usable versus the linq expression it was giving.

Sweet!  Thanks!!
0
Rob Dismaya
Top achievements
Rank 1
answered on 18 Aug 2010, 05:37 PM
I am trying to implement the same thing. I'd like to pass the filtering expression to the stored procedure in the where clause but when I check the columns evaluatefilterexpression it comes up empty. Are you looping thru all the columns filtering and building a dynamic sql statement? If that is possible I'd like to know how to do it. Thanks.
0
Mira
Telerik team
answered on 23 Aug 2010, 12:50 PM
Hello Rob,

I recommend that you use the FilterExpression property of the corresponding table view to implement the desired functionality.

I hope this helps.

Best wishes,
Mira
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Kevin Warnke
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Kevin Warnke
Top achievements
Rank 1
Rob Dismaya
Top achievements
Rank 1
Mira
Telerik team
Share this question
or