This is a migrated thread and some comments may be shown as answers.

How do I keep all PageViews from loading on Page_Load

3 Answers 66 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 2
Tim asked on 05 Jul 2011, 08:21 PM
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.

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



3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 12 Jul 2011, 01:14 PM
Hello Tim,

Can you please open a support ticket and send us a simple runnable project reproducing the issue that you encounter since the code that you provided is not enough for us to be able to observe the problem?

Thank you for your cooperation.

Greetings,
Kate
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Tim
Top achievements
Rank 2
answered on 12 Jul 2011, 02:20 PM
HI Kate,
I submitted a ticket on July 8th. Thanks
0
Kate
Telerik team
answered on 14 Jul 2011, 12:44 PM
Hello Tim,

Thank you for that, we received the ticket. We will take a look at it and come back to you as soon as possible.

Regards,
Kate
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TabStrip
Asked by
Tim
Top achievements
Rank 2
Answers by
Kate
Telerik team
Tim
Top achievements
Rank 2
Share this question
or