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

Adding RadMultiPage dynamically on page load.

1 Answer 170 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Susheel
Top achievements
Rank 1
Susheel asked on 09 Jul 2015, 01:05 PM

Hi,

I have RadTabStrip and RadMultiPage and i am adding some new Tabs and RadPageViews on Page load. Here is my code

                         RadTab objChildTab = new RadTab();
                        objChildTab.Text = "Tab1";
                        objChildTab.Value = "BAC";
                        objChildTab.PageViewID = "Page1";
                        objRadTabStrip.Tabs.Add(objChildTab);

        Note :  Here i am able to add Tabs to objRadTabStrip.

                        RadPageView pageView = new RadPageView();
                        pageView.ID = "Page1";
                        pageView.Height = 500;

                        objRadMultiPage.PageViews.Add(pageView);

      But Here i getting error :  

                                          The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases

 

 Kindly help me to identify that RadTabStrip is allowing me to add new Tabs but RadMultiPage  is not allowing me to add new RadPageViews.

 

 Thanks,

Susheel

1 Answer, 1 is accepted

Sort by
-1
Ivan Danchev
Telerik team
answered on 14 Jul 2015, 08:20 AM
Hello Susheel,

This is the right way of adding RadTabs and RadPageViews to the RadTabStrip and RadMultiPage dynamically. At my end using your code they were added and their properties were set correctly as shown in the following screenshot.

Are you adding other controls in the Page_Load handler?

Regards,
Ivan Danchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TabStrip
Asked by
Susheel
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or