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

MVC Grid Filtering ~or~ only uses first 2 filter functions

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matthew
Top achievements
Rank 2
Matthew asked on 19 Aug 2011, 06:00 PM
Hi All,

I have client filtering with a Telerik MVC Grid.


If I set a filter such as

grid.Filterby = "title~substringof~'Terminator'~or~actor~substringof~'Sylvester Stallone'~or~Director~substringof~'Ridley Scott

Only the first 2 statements in the set of  ~or~ conditions get used.

Is there any way to work around this? I've verified by rearranging my filter expressions, and the first 2 always get used first

1 Answer, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 2
answered on 19 Aug 2011, 06:04 PM
Ok.... So I just came up with a workaround incase anyone is doing something similar.

You can concatenate all of your fields together for an extra field passed to the gridmodel such as

var movies = (from m in movies select new { Title = m.Title, Actor = m.Actor, Director = m.Director, SearchString = m.Title + m.Actor + m.Director});

The problem here is your literally doubling the amount of JSON data going back and forth. When I had to do things like this elsehwere I performed all of this on the client side, but I don't want to lose/have to redo the large amount of inbuilt features with ajax binding with the grid.

Tags
Grid
Asked by
Matthew
Top achievements
Rank 2
Answers by
Matthew
Top achievements
Rank 2
Share this question
or