TreeList Item not always added

0 Answers 55 Views
TreeListView
Emy
Top achievements
Rank 1
Emy asked on 08 Apr 2022, 12:12 PM

Hello,

I've a strange issue with a treelistview.

Only when the scrollbar is at the bottom, add a new item is not "detected"  (works fine 1 /2 times and break after..., scroll to another position and add a new item works fine).

I can't reproduce the issue with an external basic "sample" , (and the issue is reproduced only for one of the two instance I have)

Basically is something like this:

public class ViewModel
{
   ObservableCollection<ItemToAdd> Items;

   void OnNewItems(ICollection<ItemToAdd> newitems)
   {
      Foreach(item in newitems)
      {
         var parentNode  = Items.where( x => x = newitem)
         parentNode?.Children.Add(item)
      }
   }
}

publicclassItemToAdd
{
   ObservableCollection <ItemToAdd> Childrens
}
<telerik:RadTreeListView x:Name="Tree"
                                 ItemsSource="{Binding Items}"
                                 CanUserFreezeColumns="False" 
                                 RowIndicatorVisibility="Collapsed" 
                                 ColumnWidth="auto" 
                                 AutoGenerateColumns="False" 
                                 IsDragDropEnabled="True"
                                 IsDropPreviewLineEnabled="False"
                                 ShowColumnHeaders="True"
                                 RowStyle="{StaticResource RowStyle}" 
                                 SelectionMode="Extended" 
                                 GridLinesVisibility="None"
                                 IsExpandedBinding="{Binding IsExpandedInTree, Mode=TwoWay}"">

...

            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>

Here my tree is like this:

> Main node
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2

It seems that disabling Virtualization solve the issue but I don't want to do this.

Any idea?

Thanks!!

Stenly
Telerik team
commented on 13 Apr 2022, 11:03 AM

I have created a sample project, in order to get as close as possible to the specified scenario, however, on my end, the control works correctly. Would it be possible to give it a try and let me know if I am missing anything?
Emy
Top achievements
Rank 1
commented on 14 Apr 2022, 01:34 PM

hi,

thanks for your feedback!

we finally found that it is the reordering of our nodes after adding a child that is the problem.

No answers yet. Maybe you can help?

Tags
TreeListView
Asked by
Emy
Top achievements
Rank 1
Share this question
or