[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7217
  • Last Modified:

Infragistics UltraTabControl - Problem changing the selected tab.

Hi
I'm using an Infragistics UltraTabControl version (Infragistics2.Win.UltraWinTabControl.v8.3.dll)

In my code depending on a certain data criteria I try to change the tab being displayed, with the following line of code.
Me.utcTemplatesAndWorkings.SelectedTab = Me.utcTemplatesAndWorkings.Tabs("tabBudgetSummary")

Nothing happens the tab does not change?

Any ideas.
0
dfincham28
Asked:
dfincham28
  • 6
  • 3
  • 2
3 Solutions
 
Erick37Commented:
Me.utcTemplatesAndWorkings.Tabs("tabBudgetSummary").Selected = True

0
 
dfincham28Author Commented:
Hi Erick37

I tried that same result.
0
 
Erick37Commented:
I tried the code by adding a tab control on a form with 10 tabs.
In a button click event I call:
Me.UltraTabControl1.Tabs(9).Selected = True
and the tab scrolls into view and becomes active.

Where in your code do you make the tab active (which event)?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dfincham28Author Commented:
Hi I tried the calling my code from a button click event and it worked.
The scenario that does not work is if I call the SelectedTab or Selected = True from the validated event on a combo box.

The selectedtab code is definately being hit i put a break point on it. The breakpoint only get hit once so it is not in some sort of crazy loop either.

thanks
0
 
CodeCruiserCommented:
Try calling the Application.DoEvents or Refresh method of the tabcontrol.
0
 
dfincham28Author Commented:
Tried Application.DoEvents and refresh still no joy.
0
 
dfincham28Author Commented:
I added a brand new tab control to the same region on the form with nothing on it just two tabs.
Same result.

Strangely I'm still able to disable tabs.
0
 
Erick37Commented:
Here is a workaround.  Not pretty, but it works.
1) disable the active tab
2) select a different tab
3) re-enable the previous active tab

        Dim activetab As Integer = UltraTabControl1.ActiveTab.Index
        UltraTabControl1.Tabs(activetab).Enabled = False
        UltraTabControl1.Tabs(2).Selected = True
        UltraTabControl1.Tabs(activetab).Enabled = True
0
 
dfincham28Author Commented:
Thanks For the suggestions.

A colleague of mine solved the problem using a delegate.
When you want to change the tab you invoke the delegate and in there you change the tab.

Don't ask me why this works but it does.
0
 
CodeCruiserCommented:
You never mentioned you are using threads or timer or backgroundworker etc!
0
 
dfincham28Author Commented:
If you want to make the tabs invisble you should also use a delegate if you have a similar problem.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now