Hi,
I have a typical tree list setup:
<telerik:RadTreeListView ItemsSource="{Binding OuterList}">
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding MiddleList}">
<telerik:TreeListViewTableDefinition.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding InnerList}"/>
</telerik:TreeListViewTableDefinition.ChildTableDefinitions>
</telerik:TreeListViewTableDefinition>
</telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>
Initially, OuterList, MiddleList and InnerList were all ObservableCollections. But when I'm adding or removing 100s of items from a list, ObservableCollection fires an event for each change and a huge amount of time (minutes) gets used up in RadTreeListView, apparently figuring out the new UI layout.
So I decided to make MiddleList a List<MyObject> property. I'd calculate the new contents of MiddleList elsewhere, then I'd set the MiddleList property to the new list. Changing that property would trigger an INotifyPropertyChanged.PropertyChanged event. All the changes would become visible to RadTreeListView in a single event.
Unfortunately, RadTreeListView doesn't seem to respond to a PropertyChanged event that changes the TreeListViewTableDefinition's ItemsSource. When I set MiddleList to a new value, the list of displayed items does not change.
Is there a way to force RadTreeListView to re-load its table definitions? Is there another approach I should be taking?
Thanks,
Bob Alexander
I have a typical tree list setup:
<telerik:RadTreeListView ItemsSource="{Binding OuterList}">
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding MiddleList}">
<telerik:TreeListViewTableDefinition.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding InnerList}"/>
</telerik:TreeListViewTableDefinition.ChildTableDefinitions>
</telerik:TreeListViewTableDefinition>
</telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>
Initially, OuterList, MiddleList and InnerList were all ObservableCollections. But when I'm adding or removing 100s of items from a list, ObservableCollection fires an event for each change and a huge amount of time (minutes) gets used up in RadTreeListView, apparently figuring out the new UI layout.
So I decided to make MiddleList a List<MyObject> property. I'd calculate the new contents of MiddleList elsewhere, then I'd set the MiddleList property to the new list. Changing that property would trigger an INotifyPropertyChanged.PropertyChanged event. All the changes would become visible to RadTreeListView in a single event.
Unfortunately, RadTreeListView doesn't seem to respond to a PropertyChanged event that changes the TreeListViewTableDefinition's ItemsSource. When I set MiddleList to a new value, the list of displayed items does not change.
Is there a way to force RadTreeListView to re-load its table definitions? Is there another approach I should be taking?
Thanks,
Bob Alexander