protected void reportGridView_PageIndexChanged(object sender, EventArgs e) { reportGridView.CurrentPageIndex = reportGridView.PageIndex + 1; if (reportGridView.FocusedRowIndex < 0 && reportGridView.PageIndex == 0) { ((Cff.SaferTrader.Web.UserControls.CffGridView)sender).FocusedRowIndex = 0; } try { reportGridView.FindVisibleIndexByKeyValue(reportGridView.FocusedRowIndex); } catch { if ((reportGridView.CurrentPageIndex != reportGridView.PageIndex + 1) && (reportGridView.CurrentPageIndex >= 0)) { reportGridView.FocusedRowIndex = (reportGridView.PageIndex + 1) * reportGridView.defaultPageSize; reportGridView.CurrentFocusedRow = reportGridView.FocusedRowIndex; } else { reportGridView.FocusedRowIndex = reportGridView.CurrentFocusedRow; } reportGridView.FindVisibleIndexByKeyValue(reportGridView.FocusedRowIndex); } finally { } reportGridView.Caption = "Page " + reportGridView.CurrentPageIndex; reportGridView.Focus(); reportGridView.Enabled = true; }