Unplanned
Last Updated: 11 Aug 2025 15:37 by ADMIN
Jan
Created on: 29 Jan 2025 11:20
Category: TreeList
Type: Bug Report
4
Rebinding collapses TreeList

The TreeList renders its initial items expanded by default. However, if the Data collection is replaced, the new items will collapse.

The issue appears only when clearing the collection (or creating a new empty collection) and then adding the new items in it. If you create a new collection reference based on the current collection of items, there is no problem and the new items appear expended.

Reproduction: https://blazorrepl.telerik.com/wJEbcXvb207dv5vU11.

======

TELERIK EDIT: You can override the Equals() method of the TreeList model class to prevent the issue:

    public class Employee
    {
        public int Id { get; set; }
        public int? ParentId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Position { get; set; }

        public override bool Equals(object? obj)
        {
            return obj is Employee && ((Employee)obj).Id == Id;
        }
    }

2 comments
ADMIN
Ivan Danchev
Posted on: 11 Aug 2025 15:37

The issue also occurs in the Gantt: https://blazorrepl.telerik.com/GzusPFvp28jNWdDU35 

The workaround suggested in the description is applicable.

Regards,
Ivan Danchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Carl
Posted on: 04 Feb 2025 10:51
We also see the same thing in a TreeView