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)
T childOfChild = FindChild<T>(child);
if (childOfChild != 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.