I examined your code snippets and I noticed that you're populating the RadTreeView
. However, when using the UIVirtualization
feature of the control, it's important to note that it is designed to work within a databound RadTreeView
. This means that it will only work correctly, if the RadTreeView
collection is populated with business items.
I believe that this is causing your issue, and therefore I'd like to suggest a different approach for your scenario. As you have a collection of data items, you can directly use it as the RadTreeView
. This will leave the RadTreeViewItems
generation process up to the RadTreeView and the virtualizaiton feature. Please have a look at our demo solution
as it can get you started.
Furthermore, the built-in CheckBox/RadioButtons
support is designed to work with declaratively populated RadTreeView
and if you databind the control, it would be better to create two separate DataTemplates
for the items - one with a CheckBox
and one with a RadioButton
. This will allow you to use the ItemTemplateSelector
to choose the ItemTemplate
of each item based on your data type or properties. And you will also be able to control the check state of the items in your view models. For example in a MVVM scenario, we recommend using such an approach to create a 'tri-state' checking logic as described in this tutorial
Please try this approach instead and let us know if you still encounter any issues.
the Telerik team