How can I know when all tabs are loaded?

2 posts, 0 answers
  1. C Bates
    C Bates avatar
    33 posts
    Member since:
    Oct 2009

    Posted 14 Apr 2011 Link to this post

    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...
  2. Petar Mladenov
    Petar Mladenov avatar
    3136 posts

    Posted 19 Apr 2011 Link to this post

    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()
             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
Back to Top