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

[Solved] MVC Grid Server Filtering

1 Answer 39 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.
Livercool
Top achievements
Rank 1
Livercool asked on 31 Oct 2010, 01:49 PM

Hi there,

I've implemented this code below:

.Filterable(filtering => filtering
                .Filters(filters => filters
                    .Add(o => o.FirstName.Contains((String)ViewData["firstName"]))
                )
            )

I've also put the code below in the controller:
ViewData["firstName"] = firstName ?? String.Empty;



But the filtering does not happen.

I even diplayed the ViewData["firstName"] on the page to see whether the value is being passed correctly when the page post back and the values does diplay correctly.
Am I missing something?

1 Answer, 1 is accepted

Sort by
0
Livercool
Top achievements
Rank 1
answered on 31 Oct 2010, 02:50 PM
Found the problem!

.Filterable(filtering => filtering
                .Filters(filters => filters
                    .Add(o => o.FirstName).Contains((String)ViewData["firstName"])
                )
            )

1 Bracket at the wrong place!!!
Tags
General Discussions
Asked by
Livercool
Top achievements
Rank 1
Answers by
Livercool
Top achievements
Rank 1
Share this question
or