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

[Solved] Grid Paging with Custom Search Input Param

0 Answers 91 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.
Love
Top achievements
Rank 1
Love asked on 15 Feb 2011, 08:54 PM
We are using Telerik MVC Grid. We want Ajax Paging and Sorting however we want our Search Screen to perform search and populate the grid.

we are using Passing parameters to telerik asp.net mvc grid to perform search. However here is the problem:

Can we have overloaded action method? In all cases I can either fire _Index() or _Index(string submittedby).  but can't pick up selectively.
[GridAction]
        public ActionResult _Index()
        {
            var records = Repository.GetQueue();
            return View(new GridModel(records));
        }
  
        [GridAction]
        public ActionResult _Index(string submittedby)
        {
            var records = Repository.GetQueue();
            if (!string.IsNullOrEmpty(submittedby))
            {
                records = records.Where(x => x.RequestorName.Contains(submittedby));            }
  
            var gridModel = new GridModel<ViewModel>
            {
                Data = results,
            };
  
            return View(gridModel);
        }
Tags
Grid
Asked by
Love
Top achievements
Rank 1
Share this question
or