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

[Solved] ASP.Net MVC Razor grid filtering

0 Answers 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tatyana
Top achievements
Rank 1
Tatyana asked on 27 Nov 2011, 08:35 PM
I am having a hard time figuring out how to extract a filtering expression from the grid to pass it to the service call where we do all the sorting and pagination. I found a way to get an expression by extracting the filterDescriptor string as:

[

 

GridAction(EnableCustomBinding=true)]

 

 

 

public ActionResult _CustomBinding(GridCommand command)

 

{

ViewData[

 

"total"] = 12;

 

ExpressionBuilder.Expression<Order>(command.FilterDescriptors).ToString();
//returns:
//"item => ((IIF((item != null), item.OrderID, null) ?? \"\").ToLower() == \"B100001\".ToLower())"

 

 

 

}

 

 

 


I am not sure how to parse or what to do with the returned string. Any ideas?

 

What is the right way to do it?

Tags
General Discussions
Asked by
Tatyana
Top achievements
Rank 1
Share this question
or