RadMenu and RadTabStrip

2 posts, 0 answers
  1. Rama
    Rama avatar
    4 posts
    Member since:
    Sep 2008

    Posted 13 Apr 2009 Link to this post

    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



  2. Alex Lawson
    Alex Lawson avatar
    43 posts
    Member since:
    May 2008

    Posted 13 May 2009 Link to this post

    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...




Back to Top