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

Clarifications in Dynamic Tab Strip

1 Answer 75 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 01 Jun 2009, 06:15 AM
Hi All,
       1. I have created a Dynamic tab strip as similar to the "Load on Demand RadPageView". It works fine, but here in the example there use 3 different usercontrols. In my scenario the tabs are created depending on the dropdown selection. so i have kept 1 user control for all the tabs. Now i need to get the selected or clicked tab text in the user control to populate the data grid in the usercontrol. Is it possible to get n interact according to the selection.

protected void rmpCoverage_PageViewCreated(object sender, RadMultiPageEventArgs e) 
    { 
         
            string userControlName = "../UserControls/Question.ascx"
 
            userControlPage = Page.LoadControl(userControlName); 
 
            userControlPage.ID = e.PageView.ID + "_userControl"
 
            e.PageView.Controls.Add(userControlPage); 
         
    } 


2. I tried changing the dynamic to hierarichal tabstrip. the child menu wil remain the same for all the dynamic parent tab menu, So while creating the menu i hard code the child tabstrip. It works fine but.. the child tabs are always selected. how do i make it look clickable.

private void AddTab(string tabName) 
    { 
        RadTab tab = new RadTab(); 
        RadTab tabChild = new RadTab (); 
        tabChild.Text ="Additional Questions"
        RadTab tabChild1 = new RadTab(); 
        tabChild1.Text = "Questions"
        tab.Text = tabName; 
        tab.Tabs.Add(tabChild); 
        tab.Tabs.Add(tabChild1); 
        rtsCoverage.Tabs.Add(tab); 
    } 

The child tab is clickable.. but when i load the parent tab the child tabs  are always selected. It should be selected after i click it.
The click of the child menu will also call the same usercontrol. So the click event capturing is imp to manipulate the user control depending on the clicked tab. How do i get it  Hope so i am clear in my questions. Seeking experts idea.

Thanks
ArunKumar.M

1 Answer, 1 is accepted

Sort by
0
Alex Lawson
Top achievements
Rank 1
answered on 18 Jun 2009, 04:05 PM
Hi Arun,

Regarding point 1 you can get the selected tab text by capturing the 'OnClientTabSelected' event and running something similar to:

var

 

tabStrip = $find("<%= yourTabStrip.ClientID %>");

 

 

var selectedTab = tabStrip.get_selectedTab();

 

 

var tabText = selectedTab.get_text();

Is this what you meant?

On point 2, I run a similar tabstrip but it doesn't select the child tab... Have you tried looping through the tabs collection and firing the unselect method fro each one?  If that doesn't work then you could always generate a blank pageview to be displayed first.

 

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