/// <summary> /// �����ҳ�¼� /// </summary> /// <param name="e"></param> protected virtual void OnPagerChanged(PageChangedEventArgs e) { if (PagerChanged != null) PagerChanged(this, e); }
/// <summary> /// ����ط��¼� /// </summary> /// <param name="eventArgument"></param> public void RaisePostBackEvent(string eventArgument) { // TODO: ��� XPager.RaisePostBackEvent ʵ�� //Page.Response.Write( eventArgument + currentPageIndex ) ; PageChangedEventArgs args = new PageChangedEventArgs(); args.OldPageIndex = this.currentPageIndex ; args.RecordCount = this.recordCount; args.PageSize = this.PageSize ; if( eventArgument == "pre" ) { args.NewPageIndex = args.OldPageIndex -1 ; args.EventType = PagerEventType.PageIndexChanged ; } else if( eventArgument == "next" ) { args.NewPageIndex = args.OldPageIndex + 1 ; args.EventType = PagerEventType.PageIndexChanged ; } else if( eventArgument == "go-input" ) { try { //args.NewPageIndex = Convert.ToInt32( this._sPageIndexFromInput ) - 1 ; if (Int32.TryParse(this._sPageIndexFromInput, out args.NewPageIndex)) args.NewPageIndex = args.NewPageIndex - 1; if( args.NewPageIndex >= this.pageCount ) args.NewPageIndex = this.pageCount - 1; if( args.NewPageIndex < 0 ) args.NewPageIndex = 0 ; } catch { args.NewPageIndex = 0 ; } args.EventType = PagerEventType.PageIndexChanged ; } else if( eventArgument == "go-select" ) { args.NewPageIndex = Convert.ToInt32( this._sPageIndexFromSelect ) - 1 ; args.EventType = PagerEventType.PageIndexChanged ; } else if( eventArgument == "ps" ) //ҳ���ñ� { args.NewPageIndex = 0 ; //args.PageSize = Convert.ToInt32( this._sPageSize ) ; //this.currentPageSize = args.PageSize ; args.EventType = PagerEventType.PageSizeChanged ; } else if( eventArgument == "pregroup" ) { int start = ( this.CurrentPageIndex / this.NumericButtonCount ) * this.NumericButtonCount ; args.NewPageIndex = start - this.NumericButtonCount ; args.EventType = PagerEventType.PageSizeChanged ; } else if( eventArgument == "nextgroup" ) { int start = ( this.CurrentPageIndex / this.NumericButtonCount ) * this.NumericButtonCount ; args.NewPageIndex = start + this.NumericButtonCount ; args.EventType = PagerEventType.PageSizeChanged ; } else { args.NewPageIndex = Convert.ToInt32( eventArgument ) ; ; args.EventType = PagerEventType.PageIndexChanged; } currentPageIndex = args.NewPageIndex ; //Page.Response.Write( eventArgument ); this.OnPagerChanged( args ) ; }