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

RadMenu and RadTabStrip

1 Answer 106 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Rama
Top achievements
Rank 1
Rama asked on 13 Apr 2009, 03:43 PM
Hello,
I am trying to use RadMenu in conjunction with RadTabStrip.

My requirement in as follows:
Have a RadMenu with two menuitems (Item1,Item2), clicking on the menu item should create a new RadTab and a new RadPageView. Each of these RadPageView's is loaded with a user control (.ascx) based on the menu item clicked.

To Acheive this, I am handling the ItemClick event of RadMenu. This event handler does the following
  1. Create a new RadTab object.
  2. Add this object to RadTabStrip on the page
  3. Create a new RadPageView object
  4. Load the corresponding user control and the same to the new page view
  5. Setting PageViewID of the tab to the corresponding PageView.ID
  6. Add this object to RadMultiPage on the page.

All of this seems to be working fine. When the menu item (Item1) is clicked, RadTab is getting created and its corresponding RadPageView is also getting created properly.

When the second menu item (item2) is clicked, I find that the previous added RadPageView (of Item1) exisits but the user controls added in this page view are no more present !

How can i fix this issue so that clicking of menu items does not cause the controls  to vanish?

Thanks
Rama



1 Answer, 1 is accepted

Sort by
0
Alex Lawson
Top achievements
Rank 1
answered on 13 May 2009, 04:36 PM
Hi Rama,

Are you using client or server side code on your menu click.  I have developed a project with a menu initiating tabs and found that postbacks were a problem when creating the controls.  The clietn side method I used was defined as OnClientItemClicked="MenuClick"
:

        function MenuClick(sender, eventArgs) 
        { 
            var tabStrip = $find("<%= rtsView.ClientID %>"); 
            tabStrip.trackChanges(); 
            var tab = new Telerik.Web.UI.RadTab(); 
            tab.set_text("thistab"); 
            tab.set_value("1"); 
            tabStrip.get_tabs().add(tab); 
            tabStrip.commitChanges(); 
            tab.select(); 
        } 

Don't know if this helps?  If not please post some code...




Tags
TabStrip
Asked by
Rama
Top achievements
Rank 1
Answers by
Alex Lawson
Top achievements
Rank 1
Share this question
or