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

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

1 Answer 226 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 08 Feb 2017, 02:44 PM

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.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Feb 2017, 06:56 AM
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.
Tags
TabStrip
Asked by
Anders
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or