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

[Solved] Grid sorting with form data

0 Answers 28 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.
john johnson
Top achievements
Rank 1
john johnson asked on 16 Mar 2010, 05:17 PM
Hi,

I want to use a Grid which is generated by taking user input from some textboxes on a page.  I can get this part to work, but when one of the columns is being sorted, the ajax binding method is getting called:
[GridAction] 
        public ActionResult _AjaxBinding() 
        { 
            return View(new GridModel<ReportResults> { Data = ??? } ); 
        } 

The examples use the northwind database, where the dataContext.Orders object is the source of the data for the grid.  In my case, however, my grid data is dependent on the values from the textboxes, and I don't seem to have access to them in this method.  Also, the stored procedure I'm running is somewhat lengthy... I don't really want to have to call it every time a user sorts a column.  Is there any way to pass the data to the controller on sorting?  I assumed ViewData.Model would contain it, but the object is null.  Any help would be appreciated greatly.
Tags
Grid
Asked by
john johnson
Top achievements
Rank 1
Share this question
or