RadTabItem object not found until it is selected or gets focus

2 posts, 0 answers
  1. Kam
    Kam avatar
    3 posts
    Member since:
    Aug 2011

    Posted 03 Apr 2012 Link to this post

    Our scenario is as follows:

    We have 4 tabitems for a RadTabControl (Tab1, Tab2, Tab3, Tab4) in this order and Tab1 is set as the selected tab when the RadTabControl is loaded for the first time.

    The parent user control that wraps this RadTabControl when tries to find the Tab4 (without Tab4 set to focus or a manual user selection), the following code we run by in Framework is unable to locate it.. 

    To reiterate the point, if that Tab4 is set as the first tab item or has focus or has a manual user selection - the same piece of code locates the Tab4.

            private static T FindChild<T>(DependencyObject parent) where T : DependencyObject


                for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)


                    DependencyObject child = VisualTreeHelper.GetChild(parent, i);

                    if (child != null && child is T)

                        return (T)child;



                        T childOfChild = FindChild<T>(child);

                        if (childOfChild != null)

                            return childOfChild;



                return null;


    Let us know if there is a property that we can apply for a specific RadTabItem to ensure the tabitem object is created as soon as the RadTabControl (as a container object) is created/loaded.

    Thanks much
    Kam Panchal
  2. Hristo
    Hristo avatar
    352 posts

    Posted 04 Apr 2012 Link to this post


    I've tried to simulate the issue but with no avail. I've prepared a sample project with your code included (copy paste from your post). Could you please give it a try and change it to simulate the issue?

    On a side note, I just wanted to encourage you to take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff and attach a sample project.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top