Load-On-Demand data bound controls in RadPageView when they are selected by RadTab

2 posts, 0 answers
  1. Ingemar
    Ingemar avatar
    27 posts
    Member since:
    Apr 2012

    Posted 08 Feb 2017 Link to this post

    In my webpage, I have a RadTabStrip containing RadTab:s which will decide which page view the webpage that is shown.

    <telerik:RadTabStrip ID="rtsTabs2" runat="server" Width="100%" MultiPageID="rmpMultiPage2" AutoPostBack="True" SelectedIndex="0" OnTabClick="rtsTabs2_TabClick">
      <Tabs>
        <telerik:RadTab Text="Page 1" PageViewID="pvPage1" />
        <telerik:RadTab Text="Page 2" PageViewID="pvPage2" />
      </Tabs>
    </telerik:RadTabStrip>

     

    The page views are defined like this:

    <telerik:RadMultiPage ID="rmpMultiPage2" runat="server">
      <telerik:RadPageView ID="pvPage1" runat="server"> RadGrids etc </telerik:RadPageView>
        <telerik:RadPageView ID="pvPage2" runat="server"> More RadGrids etc </telerik:RadPageView>
    </telerik:RadMultiPage>

    The page views contains numerous components that will be populated from the database.

    However, I will only be interested in populate those when a page view containing them is displayed.

    Which event should I listed at to determine when to populate components?

    • The OnLoad event in RadPageView is triggered when the page load, regardless if the page view is shown or not.
    • The OnPreRender event in RadPageView is also triggered on page load.
    • The OnNeedDataSource event in GridView is the same, the event triggers when the page loads.
    • Using Visible="False" in a RadPageView only results in page views that will never show up even if the corresponding RadTab is clicked.
  2. Eyup
    Admin
    Eyup avatar
    3535 posts

    Posted 13 Feb 2017 Link to this post

    Hi Ingemar,

    You can examine the solutions provided in the following sample to achieve this requirement:
    http://www.telerik.com/support/code-library/load-the-selected-pageview-only-the-first-time

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top