This question is locked. New answers and comments are not allowed.
I have a grid that is Server bound the first pass but then uses Ajax binding for subsquent requests. So when the user clicks on the column header to sort by that column it calls the Ajax method in my controller class. In that method I am using this method in my controller class:
I was wondering if anyone knew of an easy way to "reselect" the row that the user had previously selected in the Grid? I have the row they selected stored in session but I don't see any API to select the row during the ajax binding. I know I could hack around it in the View and change the style of the row based on the selection I have in session but was hoping to find an API i could use since this seems like a common thing to do.
Basically I am trying to not lose the row that the user selected before they did a sort in the MVC grid. Any help or suggestions would be greatly appreciated.
Thanks,
Paul
[GridAction] public ActionResult Grid_AjaxBinding(GridCommand command) { List<MyViewModel> selectedRecords; CustomResult webServiceResult = GetSearchResults(this.SearchParameters, out selectedRecords); GridModel gridModel = new GridModel() { Data = selectedRecords, Total = selectedRecords.TotalCount }; return View(gridModel); } I was wondering if anyone knew of an easy way to "reselect" the row that the user had previously selected in the Grid? I have the row they selected stored in session but I don't see any API to select the row during the ajax binding. I know I could hack around it in the View and change the style of the row based on the selection I have in session but was hoping to find an API i could use since this seems like a common thing to do.
Basically I am trying to not lose the row that the user selected before they did a sort in the MVC grid. Any help or suggestions would be greatly appreciated.
Thanks,
Paul