// Fires when the page is changed private void PagedResults_PageChanging(object sender, PageChangingEventArgs e) { // Don't do anything if the requested page's results have already been retrieved if (_pagesRetrieved.Contains(e.NewPageIndex)) return; // Set flag indicating that the ensuing search is due to the page being changed _pageChangeSearch = true; if (e.NewPageIndex == 0) // Should never be the case, but coding defensively here _searchStartIndex = 1; else _searchStartIndex = e.NewPageIndex * _pageSize + 1; // Add the requested page to the list of those that have been retrieved _pagesRetrieved.Add(e.NewPageIndex); // Request results for the page doSearch(_lastSearch); // Prevent the page from changing. Once the results are returned, it will be changed // programmatically e.Cancel = true; }
/// <summary> /// Raises the PageChanging event /// </summary> /// <param name="newPageIndex">Index of the requested page</param> /// <returns>True if the event is cancelled (e.Cancel was set to True), False otherwise</returns> private bool RaisePageChanging(int newPageIndex) { EventHandler<PageChangingEventArgs> handler = this.PageChanging; if (handler != null) { PageChangingEventArgs pageChangingEventArgs = new PageChangingEventArgs(newPageIndex); handler(this, pageChangingEventArgs); return pageChangingEventArgs.Cancel; } return false; }
private void PageChanging(object sender, System.ComponentModel.PageChangingEventArgs e) { WriteToLog(string.Format("Moving to page {0}", e.NewPageIndex + 1)); }
private bool OnPageChanging(int newPageIndex) { PageChangingEventArgs e = new PageChangingEventArgs(newPageIndex); if (this.PageChanging != null) { this.PageChanging(this, e); } return e.Cancel; }
private void radGridView2_PageChanging(object sender, PageChangingEventArgs e) { radButtonElement2.Enabled = false; }
/// <summary> /// 分页处理 /// </summary> /// <param name="e">分页参数</param> protected virtual void OnPageChanging(PageChangingEventArgs e) { PageChangingEventHandler handler = (PageChangingEventHandler)base.Events[EventPageChanging]; if (handler != null) { handler(this, e); if (!e.Cancel) { CurrentPageIndex = e.NewPageIndex; OnPageChanged(new PagingArgs(ItemCount, e.NewPageIndex, PageSize, PageCount)); } } else { CurrentPageIndex = e.NewPageIndex; OnPageChanged(new PagingArgs(ItemCount, e.NewPageIndex, PageSize, PageCount)); } }
private bool RaisePageChanging(int newPageIndex) { EventHandler<PageChangingEventArgs> pageChanging = this.PageChanging; if (pageChanging != null) { PageChangingEventArgs e = new PageChangingEventArgs(newPageIndex); pageChanging(this, e); return e.Cancel; } return false; }
// This is an ugly way of setting the IsLoading property - we assume, // not entirely correctly, that data is "loading" as pages are changing. // Note this doesn't indicate that the DS is being queried, just that // data is "loading". We don't otherwise know, except maybe by listening // on the entity manager, when a fetch is occurring. Right now, the // IsLoading is only here to mimic the RIA DDS and to set the IsBusy flag. private void pcv_PageChanging(object sender, PageChangingEventArgs e) { IsLoadingData = true; }
/// <summary> /// 回发处理事件 /// </summary> /// <param name="postArgs"></param> public new void RaisePostBackEvent(string postArgs) { base.RaisePostBackEvent(postArgs); int pageIndex = 1; if (!int.TryParse(postArgs, out pageIndex)) { inputPageIndex = Page.Request.Form[this.UniqueID + "intputPageIndex"]; if (!int.TryParse(inputPageIndex, out pageIndex)) pageIndex = CurrentPageIndex; } inputPageSize = Page.Request.Form[this.UniqueID + "inputPageSize"]; int pageSize = 10; int.TryParse(inputPageSize, out pageSize); if (pageIndex < 1) pageIndex = 1; int pageCount = (int)(Math.Ceiling(ItemCount / (double)pageSize)); if (pageIndex > pageCount) pageIndex = pageCount; if (pageIndex != CurrentPageIndex || PageSize != pageSize) { CurrentPageIndex = pageIndex; PageSize = pageSize; } PageChangingEventArgs pagingArgs = new PageChangingEventArgs(pageIndex); OnPageChanging(pagingArgs); }
/// <summary> /// Handles page changing events raised by the <see cref="IPagedCollectionView"/>. /// </summary> /// <param name="sender">The <see cref="IPagedCollectionView"/></param> /// <param name="e">The event to handle</param> private void OnPagedCollectionViewPageChanging(object sender, PageChangingEventArgs e) { this.OnPageChanging(e); }
/// <summary> /// Raises page changing events /// </summary> /// <param name="e">The event to raise</param> private void OnPageChanging(PageChangingEventArgs e) { EventHandler<PageChangingEventArgs> handler = this.PageChanging; if (handler != null) { handler(this, e); } }
/// <summary> /// Fires PageChanging event. /// </summary> /// <param name="newPageIndex"></param> /// <returns>true if ok to change page, otherwise cancel</returns> protected bool OnPageChanging(int newPageIndex) { if (PageChanging != null) { PageChangingEventArgs args = new PageChangingEventArgs(newPageIndex); PageChanging(this, args); if (args.Cancel) { return false; } } return true; }
/// <summary> /// Raises a <see cref="PageChanging"/> event /// </summary> /// <param name="e">The event args</param> protected virtual void OnPageChanging(PageChangingEventArgs e) { EventHandler<PageChangingEventArgs> handler = this.PageChanging; if (handler != null) { handler(this, e); } }
/// <summary> /// Begins a page move by raising events and updating state before calling /// <see cref="BeginMoveToPageCore"/>. /// </summary> /// <remarks> /// Every successful call to <see cref="BeginMoveToPage"/> should be matched by a call /// to <see cref="EndMoveToPage"/> when the page move is complete. /// </remarks> /// <param name="pageIndex">The index of the page to move to</param> /// <returns><c>true</c> if the operation was successful; otherwise, <c>false</c>.</returns> protected bool BeginMoveToPage(int pageIndex) { PageChangingEventArgs e = new PageChangingEventArgs(pageIndex); this.OnPageChanging(e); // re-entrant if (e.Cancel) { return false; } this.IsPageChanging = true; // re-entrant this.BeginMoveToPageCore(pageIndex); return true; }
void _photos_PageChanging(object sender, System.ComponentModel.PageChangingEventArgs e) { IsBusy = true; }
/// <summary> /// Handles <see cref="IPagedCollectionView.PageChanging"/> events raised by the <see cref="PagedCollectionView"/> /// </summary> /// <param name="sender">The <see cref="PagedCollectionView"/></param> /// <param name="e">The event args</param> protected virtual void OnPagedCollectionViewPageChanging(object sender, PageChangingEventArgs e) { this.OnPageChanging(e); }