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

How can I know when all tabs are loaded?

1 Answer 70 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
C Bates
Top achievements
Rank 1
C Bates asked on 14 Apr 2011, 01:59 PM
Hello --
We have a RadTabControl with an arbitrary number of RadTabItems.  When our application starts, how can we know all the tab items are completely displayed so we can set a specific tab as the selected item?
Thanks for any advice...

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 19 Apr 2011, 02:44 PM
Hi C Bates,

You can use the Loaded event of the RadTabControl. Basically, after the currently selected tab (by default it is the first one initially) is loaded, first the Loaded event of the tabControl is fired, then the Loaded event of the current tab is fired. Then on every selection change (no matter whether you select a previously selected tabitem or not) only the Loaded event of the TabItem fires.
<telerik:RadTabControl x:Name="tabControl"  Loaded="RadTabControl_Loaded" />
public MainPage()
     {
         InitializeComponent();
         this.tabControl.ItemsSource = Enumerable.Range(0, 1000).Select(x => "item" + x);
     }     
     private void RadTabControl_Loaded(object sender, RoutedEventArgs e)
     {
         this.tabControl.SelectedItem = this.tabControl.Items[997];
     }
Let us know if this fits in your scenario.

All the best,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabControl
Asked by
C Bates
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or