protected virtual void OnTotalRowCountAvailable(object sender, PageEventArgs e)
        {
            _totalRowCount = e.TotalRowCount;
            _maximumRows   = e.MaximumRows;
            _startRowIndex = e.StartRowIndex;

            // Sanity checks: if the total row count is less than the current start row
            // index, we must adjust and rebind the associated container control
            if (_totalRowCount > 0 && (_totalRowCount <= _startRowIndex))
            {
                // Adjust the container's start row index to the new maximum rows
                // count, but do not touch our index - we aren't a "view", so we
                // don't want/need to change the start index.
                int tmp = _startRowIndex - _maximumRows;
                if (tmp < 0 || tmp >= _totalRowCount)
                {
                    tmp = 0;
                }

                // Trigger the databinding, which will call us again, with adjusted
                // data, so that we can recreate the pager fields.
                _pageableContainer.SetPageProperties(tmp, _maximumRows, true);
            }
            else if (!_createPagerFieldsRunning)
            {
                // No adjustments necessary, re-create the pager fields
                CreatePagerFields();
            }
        }
Esempio n. 2
0
        protected virtual void OnTotalRowCountAvailable(object sender, PageEventArgs e)
        {
            _totalRowCount = e.TotalRowCount;
            _startRowIndex = e.StartRowIndex;
            _maximumRows   = e.MaximumRows;

            if (_totalRowCount <= _startRowIndex && _totalRowCount > 0)
            {
                // The last item got deleted or the results set changed and has fewer items.  Move to the prior page.
                int newStartIndex = _startRowIndex - _maximumRows;
                if (newStartIndex < 0)
                {
                    newStartIndex = 0;
                }

                // If we can't just go back one page, go back to the first page.  Most likely it's a new
                // results set.
                if (newStartIndex >= _totalRowCount)
                {
                    newStartIndex = 0;
                }

                // Rebind the IPageableItemContainer with the corrected values
                _pageableItemContainer.SetPageProperties(newStartIndex, _maximumRows, true);
                return;
            }

            if (!_creatingPagerFields)
            {
                CreatePagerFields();
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 private void OnTotalRowCountAvailable(PageEventArgs e)
 {
     EventHandler<PageEventArgs> handler = (EventHandler<PageEventArgs>)base.Events[GridView.EventTotalRowCountAvailable];
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 4
0
		protected override void OnTotalRowCountAvailable (PageEventArgs e)
		{
			RecordEvent ("Enter");
			base.OnTotalRowCountAvailable (e);
			RecordEvent ("Leave");
		}
Esempio n. 5
0
        protected virtual void OnTotalRowCountAvailable(object sender, PageEventArgs e) {
            _totalRowCount = e.TotalRowCount;
            _startRowIndex = e.StartRowIndex;
            _maximumRows = e.MaximumRows;

            if (_totalRowCount <= _startRowIndex && _totalRowCount > 0) {
                // The last item got deleted or the results set changed and has fewer items.  Move to the prior page.
                int newStartIndex = _startRowIndex - _maximumRows;
                if (newStartIndex < 0) {
                    newStartIndex = 0;
                }

                // If we can't just go back one page, go back to the first page.  Most likely it's a new
                // results set.
                if (newStartIndex >= _totalRowCount) {
                    newStartIndex = 0;
                }

                // Rebind the IPageableItemContainer with the corrected values
                _pageableItemContainer.SetPageProperties(newStartIndex, _maximumRows, true);
                return;
            }

            if (!_creatingPagerFields) {
                CreatePagerFields();
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnTotalRowCountAvailable(PageEventArgs e)
 {
     EventHandler<PageEventArgs> handler = (EventHandler<PageEventArgs>)base.Events[NopDataPagerGridView.EventTotalRowCountAvailable];
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 7
0
 protected void OnSaveCmsPageEvent(object sender, PageEventArgs e)
 {
     //TODO: Ignore unregistered Content?
     if(Content.IsAvailable && !IsLinked){
         SavePlaceHolderContent();
         contentPersister.SaveContent(this.ID, e.PageID);
     }
 }
Esempio n. 8
0
		protected virtual void OnTotalRowCountAvailable (object sender, PageEventArgs e)
		{
			_totalRowCount = e.TotalRowCount;
			_maximumRows = e.MaximumRows;
			_startRowIndex = e.StartRowIndex;
			
			// Sanity checks: if the total row count is less than the current start row
			// index, we must adjust and rebind the associated container control
			if (_totalRowCount > 0 && (_totalRowCount <= _startRowIndex)) {
				// Adjust the container's start row index to the new maximum rows
				// count, but do not touch our index - we aren't a "view", so we
				// don't want/need to change the start index.
				int tmp = _startRowIndex - _maximumRows;
				if (tmp < 0 || tmp >= _totalRowCount)
					tmp = 0;

				// Trigger the databinding, which will call us again, with adjusted
				// data, so that we can recreate the pager fields.
				_pageableContainer.SetPageProperties (tmp, _maximumRows, true);
			} else if (!_createPagerFieldsRunning)
				// No adjustments necessary, re-create the pager fields
				CreatePagerFields ();
		}
Esempio n. 9
0
 protected virtual void OnTotalRowCountAvailable(PageEventArgs e) {
     EventHandler<PageEventArgs> handler = (EventHandler<PageEventArgs>)Events[EventTotalRowCountAvailable];
     if (handler != null) {
         handler(this, e);
     }
 }
Esempio n. 10
0
 protected void OnSaveCmsPageEvent(object sender, PageEventArgs e)
 {
     if(!IsLinked){
         attribute = null;
         SavePlaceHolderContent();
         Attribute.Update();
     }
 }
 protected void rep1_TotalRowCountAvailable(object sender, PageEventArgs e)
 {
 }
Esempio n. 12
0
 protected override void OnTotalRowCountAvailable(object sender, PageEventArgs e)
 {
     base.OnTotalRowCountAvailable(sender, e);
 }