Esempio n. 1
0
        private void MoveRecords(bool refreshing = false)
        {
            if (!refreshing && OnMovingPage != null)
            {
                PagingToolbarEventArgs args = new PagingToolbarEventArgs
                {
                    CurrentPage = this.CurrentPage
                };

                OnMovingPage(this, args);

                if (args.Cancel)
                {
                    CurrentPage--;
                    return;

                }
            }

            int de = ((CurrentPage * PageSize) - PageSize) + 1;
            int ate = (de + PageSize) - 1;

            if (!DynamicPaging && ate > RecordCount)
                ate = de + (RecordCount - de);
            SetText(de, ate, DynamicPaging ? -1 : RecordCount);

            btnUltimaPagina.Enabled = !DynamicPaging;
        }
Esempio n. 2
0
        private void pagingToolbar_OnMovingPage(object sender, PagingToolbarEventArgs e)
        {
            if(_dataSource.IsDynamicPaging)
            {
                e.Cancel = !_dataSource.MoveToPage(e.CurrentPage);
                if(e.Cancel) return;
            }

            Populate();
        }