I have a MasterPage with a content page that contains a RadTabStrip
containing 5 tabs there are 5 associated user controls that load into their corresponding PageViews. I am using the following code to load the associated
user control into the selected tab.
In the Page_Init of the control I build the DataGrid based on a defined .cs file for the grid definition.
What I am seeing is every time I make a tab selection all of the PageViews are reloaded. This sample Code is being used so indeed there is no postback after all tabs have been initially loaded. However, as each tab is clicked the first time there is a postback to every control for every tab.
Even after all tabs have been initially loaded If click the refresh button of a RadDataGrid or the Pager control, all PageViews are recreated and their associated RadGridViews are repopulated even if it is not the grid I am working with. This is slowing down the presentation drastically. I know I must have missed something. Any help would be appreciated.
~Tim
private void AddTab(string tabName, string id)
{
RadTab _tab = new RadTab {Text = tabName, PageViewID = id};
RadTabStrip1.Tabs.Add(_tab);
}
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
{
string _userControlName = string.Format("/Controls/{0}.ascx", e.PageView.ID);
Control _userControl = Page.LoadControl(_userControlName);
_userControl.ID = e.PageView.ID + "_userControl";
e.PageView.Controls.Add(_userControl);
}
private void AddPageView(RadTab tab)
{
RadPageView _pageView = new RadPageView {ID = tab.PageViewID, CssClass = "pageView"};
RadMultiPage1.PageViews.Add(_pageView);
tab.PageViewID = _pageView.ID;
}
protected void RadTabStrip1_OnTabClick(object sender, RadTabStripEventArgs e)
{
AddPageView(e.Tab);
e.Tab.PageView.Selected = true;
}
In the Page_Init of the control I build the DataGrid based on a defined .cs file for the grid definition.
protected void Page_Init(object source, EventArgs e)
{
this.__activeBatchesRadGrid = PolicyRadGrid.GridDefinition();
this.PlaceHolder1.Controls.Add(this.__activeBatchesRadGrid);
}
What I am seeing is every time I make a tab selection all of the PageViews are reloaded. This sample Code is being used so indeed there is no postback after all tabs have been initially loaded. However, as each tab is clicked the first time there is a postback to every control for every tab.
Even after all tabs have been initially loaded If click the refresh button of a RadDataGrid or the Pager control, all PageViews are recreated and their associated RadGridViews are repopulated even if it is not the grid I am working with. This is slowing down the presentation drastically. I know I must have missed something. Any help would be appreciated.
~Tim