This is a migrated thread and some comments may be shown as answers.

Optimized Adds don't work?

3 Answers 43 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 01 May 2012, 02:32 PM
Hi,

I have a RadTreeListView (version 2011.2.712.35) whose ItemsSource is a custom implementation of INotifyCollectionChanged. The custom version is intended to be more efficient than ObservableCollection by bundling multiple sequential Adds or Removes into a single NotifyCollectionChanged event. The single event has a list of NewItems or OldItems with more than one item in it.

The RadTreeListView seems unable to handle this event correctly. In response to an Add event with two items, it only updates the display with the first of the items. In response to an Add event with 5 items, only the first two appear in the display.

Is this a known problem? Has it been fixed in a later version than the one I have?

Thanks,
   Bob

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 01 May 2012, 02:36 PM
Hello Bob ,

Please try using RadObservableCollection instead of your custom implementation. It supports the suspend/resume notifications pattern.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Bob
Top achievements
Rank 1
answered on 01 May 2012, 03:27 PM
Hi Pavel,

There's two reasons I don't want to use RadObservableCollection. First, my custom collection is providing other features in addition to bundling multiple actions into one event. Second, RadObservableCollection combines multiple actions into a single Reset event. This means RadTreeListView has to re-evaluate the entire list. That's potentially a lot of wasted work. Imagine, for example, a list of 100 items where two items are added. It's much faster to process two new items than to process 102 items.

But I fear from your response that the answer to my question is that RadTreeListView does not support multiple changes in a single event, and it's not going to any time soon. Am I correct?

- Bob
0
Pavel Pavlov
Telerik team
answered on 02 May 2012, 09:02 AM
Hi Bob,

Indeed in case of more than one item added/removed  RadGridView and RadTreeListView  would  rely on the Reset action. In the general this has proven to be the cheaper approach in the context of memory and performance.  If we handle individually each add/remove action when batch updates are performed with the current  architecture of RadTreeListView the end result would be near to performance disaster.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeListView
Asked by
Bob
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Bob
Top achievements
Rank 1
Share this question
or