/// <summary> /// 点下一页按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbGoToNextPage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int pageIndex = 1; try { pageIndex = TypeUtil.ToInt(barEditItemPage.EditValue); if (pageIndex + 1 <= TypeUtil.ToInt(tlbTotlePages.Caption.ToString().Replace("/", ""))) { pageIndex = pageIndex + 1; } else { MessageShowUtil.ShowInfo("已到最后一页"); } } catch { } int pageSize = 50; try { pageSize = TypeUtil.ToInt(tlbSetPerPageNumber.EditValue); } catch { } QueryGridData(pageIndex, pageSize); }
/// <summary> /// 点上一页按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbGoToPreviousPage_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int pageIndex = 1; try { pageIndex = TypeUtil.ToInt(barEditItemPage.EditValue); if (pageIndex - 1 > 0) { pageIndex = pageIndex - 1; } else { MessageShowUtil.ShowInfo("已到第一页"); } } catch { } int pageSize = 50; try { pageSize = TypeUtil.ToInt(tlbSetPerPageNumber.EditValue); } catch { } QueryGridData(pageIndex, pageSize); }