I have an UltraTabControl.
The developer hides tabs based on some application data.
I select the 3rd tab and change data then save. Works fine. I save a reference to the tab
UltraTab
selectedTab = ultraTabControl1.SelectedTab;
I call the method again. Shows all tabs then disables and sets Visible=false to tabs that shouldn't be show.
I select the 3rd tab since it was the tab the user is currently on through code.
ultraTabControl1.ActiveTab = selectedTab;
The 3rd tab is selected, but the Panel that belongs to the 1st tab is on is shown. I can click on any tab except the 1st and it won't change the tab panel.
I click the first tab and the ultratabcontrol beigns to function correctly again, but switch to the correct panel.
I tried to place BeginUpdate and EndUpdate to force a refresh.
Is there a way to re-sync the tabs after they are toggled with enabled/visisble?
Note:
I hooked to the SelectedTabChanged event also and it fires each time
Any ideas are appreciated.
Thanks,
Nick
First of all, you should probably set the SelectedTab property instead of the ActiveTab. That being said, it sounds like a control is incorrectly placed over the UltraTabControl until the 1st tab is selected. When a tab is not selected, we leave its tab page visible, but just move it to a location that cannot be seen. Perhaps the code you are using to hide and show tabs is somehow causing one of the tab pages to stay in view even though it is not selected, either by a bug in the UltraTabControl or your application code. Can you post the code you are using to hide and show the tabs or a sample demonstrating the issue?
/// <summary> /// Disables all the tabs for the six categories of organizations /// </summary> private void DisableAllTabs() { // this is the default tab and it will be visible and enabled. utpProjectDetail.Enabled = true; utpProjectDetail.Visible = true; //utpProjectDetail.Tab.Selected = true;
utpPipeline.Tab.Enabled = false; utpPipeline.Tab.Visible = false;
utpMidstream.Tab.Enabled = false; utpMidstream.Tab.Visible = false;
utpAutomation.Tab.Enabled = false; utpAutomation.Tab.Visible = false;
utpProcessIndustrial.Tab.Enabled = false; utpProcessIndustrial.Tab.Visible = false;
utpUpstream.Tab.Enabled = false; utpUpstream.Tab.Visible = false;
utpDownstream.Tab.Enabled = false; utpDownstream.Tab.Visible = false; }
/// <summary> /// Method enables one tab control based on the organization the /// user selected. Each organization has one associated category that it /// belongs to. Choices include pipeline, upstream, downstream, /// midstream, process and Industrial and Automation. /// </summary> /// <param name="projOrg"></param> private void EnableOrganizationTab(ProjectOrganization projOrg) { UltraTab selectedTab = ultraTabControl1.SelectedTab;
DisableAllTabs(); if (projOrg != null) { switch (projOrg.OrganizationCategory.Name) { case "Pipeline": //utpPipeline.Tab.Selected = true; utpPipeline.Tab.Enabled = true; utpPipeline.Tab.Visible = true; break; case "Upstream": //utpUpstream.Tab.Selected = true; utpUpstream.Tab.Enabled = true; utpUpstream.Tab.Visible = true; break; case "Process Plant Group/Downstream": //utpDownstream.Tab.Selected = true; utpDownstream.Tab.Enabled = true; utpDownstream.Tab.Visible = true; break;
case "Midstream": //utpMidstream.Tab.Selected = true; utpMidstream.Tab.Enabled = true; utpMidstream.Tab.Visible = true; break; case "Process and Industrial": //utpProcessIndustrial.Tab.Selected = true; utpProcessIndustrial.Tab.Enabled = true; utpProcessIndustrial.Tab.Visible = true; break; case "Automation": //utpAutomation.Tab.Selected = true; utpAutomation.Tab.Enabled = true; utpAutomation.Tab.Visible = true; break; default: break; } } else { utpProjectDetail.Show(); utpProjectDetail.Tab.Selected = true; }
ultraTabControl1.ActiveTab = selectedTab; //ultraTabPageControl2.Visible = true; }
utpXXXXX is the tab a previous developer has used.
Now when I take on the visible=false code and just disable the tab control works as expected.
It appears to only happen when I make the tabs invisible. I tried Refresh and BeginUpdate hoping that would force the Tab to resync it's tabs to no avail.
Thanks for looking at this.
I am not able to reproduce the issue with the code provided. What version are you using? Have you tried upgrading to the latest SR to see if it fixes your issue?
We are using a BindingSource for the data. And this DisableTabs is called 4-5 times at startup. Then when we save the data. We get a new collection of data via DomainModels(NHibernate) and clear all bindings and then call the Disbale Tabs again.
So I'm think to create it is to bind several text fields via TextBox.Databings.Add() .
1) Call Clear on each field
2) Set databindings
3) create a save button and a new refresh method. This method calls points 1 and 2
3) Load the form, make changes and click the 3rd tab. Then click save. Save will call refresh.
That should recreate it. Although this could simply be an issue of my version being older or my form has spaghetti code.
I'm an asp.net developer, so I'm not an expert at infragistics controls.
We have version 6.1.20061.28
Many fixes have been made since that version. If this is a bug in the UltraTabControl, there's a good chance it had been fixed. Try to upgrade to the latest version to see if it fixes your issue. If you do not have a subscription, download a trial version. That will tell us if it was an issue with the UltraTabControl and if so, why I cannot reproduce it now. If not, then I would probably need a sample to try to reproduce this.
k.
Thanks for the effort. I'll relay this to my manager.