This behavior is expected as the RadTreeView
control hasn't generated its RadTreeViewItem
containers at this point. Basically in order to get the containers of type RadTreeViewItem
that wrap teh business colelction, yo uneed to make sure that they are already generated.
For example you can handle the RadTreeView.ItemContainerGenerator.StatusChanged
event handler to make sure that the containers are generated before traversing the Items collection:
sender, EventArgs e)
Telerik.Windows.Controls.ItemContainerGenerator).Status == Telerik.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated)
//traverse the RadTreeView.Items collection
If you give us more details about your scenario and application, we will eb able to suggest more suitable approaches.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>