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

[Solved] Databinding with paging and filtering

0 Answers 19 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.
Pierre
Top achievements
Rank 1
Pierre asked on 22 Apr 2013, 04:12 PM
Hello,

I am using telerik grid mvc with DataBinding server side.

.DataBinding(db => db.Server().Select("Index", "Candidate", new
    {
        CandidatesFilter = ViewData["CandidatesFilter"]
    }
))

In my controller, I am returning a subset of the list if the ViewData is not null. That ViewData is an input for searching into the candidates list. The problem that I have using that is when i am on page 2 then i perform a search. The grid stays in page 2 due to the query string that stays. Is there a way to erase that query string after I return the subset? Or if anyone has an idea to fix my problem, that would be nice.

This is my controller code
public ActionResult Index(string candidatesFilter = "")
   {
      ViewData["CandidatesFilter"] = candidatesFilter;
 
      return View("Index", new GridModel<CandidateModel>(GetCandidates()));
   }


Any ideas?
Thanks
Tags
Grid
Asked by
Pierre
Top achievements
Rank 1
Share this question
or