I want to set checkbox column in gridview. Following codes do that:
gridSettings.PreRender = (sender, e) =>
{
MVCxGridView gridView = sender as MVCxGridView;
for (int i = 0; i < gridView.VisibleRowCount; i++)
{
gridView.Selection.SetSelection(i, (bool)gridView.GetRowValues(i, "IsAssigned"));
}
};
But I have about 1 million records, so grid view loading time is too long (more than 2 minutes). Because devexpress, loop all records, page by page to find selected rows (my collection is IQueryable type). If I dont try to set this column, devexpress use IQueryable list, so it fetchs only one paged data.
What can I do to loop only visible rows?
Best Answer
I changed my codes like following, I get selectedrows with tempdata in controller.