protected void gridMain_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { int recSkip = gridMain.MasterTableView.CurrentPageIndex * gridMain.MasterTableView.PageSize; int recTake = gridMain.MasterTableView.PageSize; string recFilter = gridMain.MasterTableView.FilterExpression; try { JobsController cont = new JobsController(); gridMain.VirtualItemCount = cont.CountJobs(recFilter); gridMain.DataSource = cont.GetJobs(recSkip, recTake, recFilter); } catch (Exception) { } }