Currently, Load Child on Demand is not supported when using Virtual Scrolling in the TreeGrid component due to fundamental differences in data rendering and retrieval. Load Child on Demand dynamically fetches and renders child records only when a parent row is expanded, whereas Virtual Scrolling optimizes performance by rendering only the visible rows in the viewport and fetching data dynamically as the user scrolls. This creates a conflict, as Virtual Scrolling continuously removes and re-renders rows based on scrolling position, which disrupts the tracking and persistence of expanded parent rows and their child records. Additionally, since Virtual Scrolling does not maintain an in-memory representation of all rows, expanding a parent row may cause previously loaded child rows to be lost upon scrolling. To work around this limitation, you can disable Virtual Scrolling and use alternatives like paging or infinite scrolling for better compatibility with Load Child on Demand.
Ensure below cases while implementing.
Issue 1: Misalignment issue
- Expand task 1 and 2.
- scroll down to task 26 and expand it.
- Now select the 24th taskbar note that it was misaligned and 35th taskbar is displayed instead of 24.
Issue 2: White space issue
- scroll down to the last task and expand it.
- Now scroll from there you will notice the white space at the top.