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

Reloading Tab Page Views

1 Answer 155 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
macmariman
Top achievements
Rank 2
macmariman asked on 29 May 2008, 03:34 AM
Hello all,

I have successfully implemented load on demand within a radtabstrip as shown in the demos. This allows me to load pageviews on clicking the corresponding tab as well as preventing a postback if the content has already been loaded before by using the following code:

 if (args.get_tab().get_pageView()) 
 { 
       args.get_tab().set_postBack(false); 
 } 

Now, I'd like to restore the initial behaviour (allow postback) by clicking on the corresponding button allowing the pageviews contents to be binded to different data.
Any Ideas??

Thanks,

Martín


1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 29 May 2008, 02:21 PM
Hello Martin Mari,

To restore the initial behavior you need to execute the following JavaScript code for that particular tab:

var tab = $find("RadTabStrip1").get_tabs().getTab(1);
tab.set_postBack(true);
tab.set_pageViewID(null);

Then on the server side you need to add a check inside the TabClick event handler to avoid multiple instantiation of the same RadPageView object:

        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            if (string.IsNullOrEmpty(e.Tab.PageViewID))
            {
                AddPageView(e.Tab);
            }
            e.Tab.PageView.Selected = true;
        }

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TabStrip
Asked by
macmariman
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Share this question
or