void SetUpForNewContainer(bool dataBind, bool needSetPageProperties) { if (_needNewContainerSetup) { ConnectToEvents(_pageableContainer); _needNewContainerSetup = false; } if (_needSetPageProperties) { _pageableContainer.SetPageProperties(_startRowIndex, _maximumRows, dataBind); _needSetPageProperties = needSetPageProperties; } }
protected internal override void OnInit(EventArgs e) { base.OnInit(e); // We can't try to find another control in the designer in Init. if (!DesignMode) { _pageableItemContainer = FindPageableItemContainer(); if (_pageableItemContainer != null) { ConnectToEvents(_pageableItemContainer); if (!String.IsNullOrEmpty(QueryStringField)) { _startRowIndex = GetStartRowIndexFromQueryString(); } _pageableItemContainer.SetPageProperties(_startRowIndex, _maximumRows, false); _setPageProperties = true; } if (Page != null) { Page.RegisterRequiresControlState(this); } } _initialized = true; }
/// <devdoc> /// <para>Loads the control state for those properties that should persist across postbacks /// even when EnableViewState=false.</para> /// </devdoc> protected internal override void LoadControlState(object savedState) { // Any properties that could have been set in the persistance need to be // restored to their defaults if they're not in ControlState, or they will // be restored to their persisted state instead of their empty state. _startRowIndex = 0; _maximumRows = 10; _totalRowCount = -1; object[] state = savedState as object[]; if (state != null) { base.LoadControlState(state[0]); if (state[1] != null) { _startRowIndex = (int)state[1]; } if (state[2] != null) { _maximumRows = (int)state[2]; } if (state[3] != null) { _totalRowCount = (int)state[3]; } } else { base.LoadControlState(null); } if (_pageableItemContainer == null) { _pageableItemContainer = FindPageableItemContainer(); if (_pageableItemContainer == null) { throw new InvalidOperationException(AtlasWeb.DataPager_NoPageableItemContainer); } ConnectToEvents(_pageableItemContainer); } _pageableItemContainer.SetPageProperties(_startRowIndex, _maximumRows, false); _setPageProperties = true; }