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

Dynamic enabling of tabs

1 Answer 93 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
k f
Top achievements
Rank 1
k f asked on 22 Sep 2008, 09:55 AM
You have a rad multi page with 2 tabs.  First tab is for projects, second tab is for workitems associated with the project.

Each tab loads a user control.

If the page is opened to create a new project, the workitem tab is set to enabled="false"

There is a save button in the user control contained the projects tab.  Once it creates a new project in the database, I need to pass the projectId of the new record from the User Control used in the projects tab back to the .aspx page that contains the tabs.

I've set up a delegate to transfer everything back to the main PrjEditorTabs.aspx and it fires but the workitem tab is still not enabled after I set it.

What I'm noticing is that the PageViewCreated on PrjEditorTabs.aspx page is firing before the button click event on the User Control,  so it appears the tab is already rendered before the events on the  tab user control have had a chance to fire.  I haven't ran across an example as of yet to resolve this.

If the previous is hard to follow, all I'm doing is trying to setup tabs in a multi page.  tab 1 is enabled and tab 2 is disabled upon load.  Put a button in the user control loaded by tab 1.  When that button clicked, it passes a value back to the .aspx that contains the tabs and multipage and then enables tab 2 dynamically.

1 Answer, 1 is accepted

Sort by
0
k f
Top achievements
Rank 1
answered on 22 Sep 2008, 11:35 AM
// Fired with save button is clicked on the ucPrjEditor.ascx control  
    private void OnPrjBtnSave_Click(ProjectSaveButtonClickedArgs args)  
    {  
        if (args != null)  
        {  
            if (args.ProjectId.HasValue)  
            {  
                EnableDisableTabs(rTabStripPrjEditor.Tabs, true);  
                upPnlPrjTabsEditor.Update();  
 
            }  
        }  
 
    } 

Found the problem as to why I'm having so much trouble.  I have the RadAjaxManager on the page in order to display a loading panel when the tabs change.  First I wrapped my tabs and multipage in an UpdatePanel and when the event fired which enabled all the approriate tabs, I'd set their values and call UpdatePanel.Update().

However, this throws an exception A control is already associated with the element so I removed it looking for other options.  However, remembering back to last week I had a similar issue on another page that I had the RadAjaxManager.

Removing the RadAjaxManager, wrapping the tabs and multipage in an updatePanel and calling Update when the event is fired resoved the issue for me.  Now just have to write my own loading logic.

Tags
TabStrip
Asked by
k f
Top achievements
Rank 1
Answers by
k f
Top achievements
Rank 1
Share this question
or