private void OnRequestPagingItems(int pageIndex) { if (this.RequestPagingItems != null) { var e = new RequestPagingItemsEventArgs(new PagingInfo(pageIndex, this.RowsPerPage)); this.RequestPagingItems(this, e); this.PagingItems = e.Result; } }
private void OnPagingItemsChanged(PagingItems oldValue, PagingItems newValue) { if (this.PagingItems == null || this.PagingItems.RowCount < 1) { this.panel.IsEnabled = false; this.lblInfo.Text = string.Format("第{0}页/共{1}页", 0, 0); this.iudPageIndex.Value = 1; } else { this.panel.IsEnabled = true; this.iudPageIndex.Maximum = this.PagingItems.PageCount; this.btnPrev.IsEnabled = this.btnFirst.IsEnabled = this.PagingItems.PageIndex > 0; this.btnNext.IsEnabled = this.btnLast.IsEnabled = this.PagingItems.PageIndex < this.PagingItems.PageCount - 1; this.lblInfo.Text = string.Format("第{0}页/共{1}页", this.PagingItems.PageIndex + 1, this.PagingItems.PageCount); this.iudPageIndex.Value = this.PagingItems.PageIndex + 1; } }