How do I keep all PageViews from loading on Page_Load

4 posts, 0 answers
  1. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 05 Jul 2011 Link to this post

    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



  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 12 Jul 2011 Link to this post

    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!

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tim
    Tim avatar
    60 posts
    Member since:
    May 2011

    Posted 12 Jul 2011 Link to this post

    HI Kate,
    I submitted a ticket on July 8th. Thanks
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 14 Jul 2011 Link to this post

    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!

Back to Top