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

[Solved] GridView.CheckBoxes bug

0 Answers 87 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.
ori
Top achievements
Rank 1
ori asked on 21 Feb 2012, 02:36 PM
Hi,

i have found out that when you select items from different pages in the current grid we can view only the items from the current page.
you can test it in the demos: http://demos.telerik.com/aspnet-mvc/grid/checkboxesserverside try to select 2 items from number of pages and you can see that the selected items are only from the last page.

this happens due to the event that fire on change page. This event doesnt send the selected items to the action.
therefore we got the last selected page.

i would like to know how can i override this event and send the selected items to the action.


some code:
  public ActionResult CheckBoxesServerSide(int[] checkedRecords)
       
{
            checkedRecords  
= checkedRecords ?? new int[] { };
           
ViewData["checkedRecords"] = checkedRecords;
           
           
if (checkedRecords.Any())
           
{
               
ViewData["checkedOrders"] = GetOrders().Where(o => checkedRecords.Contains(o.OrderID));
           
}
           
return View(GetOrders());
       
}
on page change this one fires and the checkRecords are null.


Thank you

Ori
Tags
Grid
Asked by
ori
Top achievements
Rank 1
Share this question
or