Unplanned
Last Updated: 16 Jul 2025 08:27 by ADMIN
Benjamin
Created on: 14 Jul 2025 12:14
Category: TreeView
Type: Bug Report
0
RadTreeView: Vertical Scroll Bar's range is not properly updating every time after collapsing node in code
The Vertical Scroll Bar's range is not properly updating every time after collapsing a node programmatically. In our case, we have several levels of node element hierarchy. Calling the Collapse() method of the first-level node will not correctly calculate the vertical scrollbar range.
5 comments
ADMIN
Dinko | Tech Support Engineer
Posted on: 16 Jul 2025 08:27

Hello Benjamin, 

I also agree that this behavior needs to be fixed in our RadTreeView control. I have already forwarded this issue to our development team for further investigation. You can follow the feedback item here to receive updates on its status. This way, you'll stay informed about its current progress.

Regards,
Dinko | Tech Support Engineer
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.

Benjamin
Posted on: 16 Jul 2025 07:45

Hi Dinko,

This workaround seems to work great.

I believe this is still an issue that should be fixed in the library since it took us quite some time to reproduce, understand and workaround. Very probably not in the only one with this problem.

Best regards,

 

Benjamin Foucher

ADMIN
Dinko | Tech Support Engineer
Posted on: 15 Jul 2025 10:20

Hi Benjamin,

Thank you for pointing out that the workaround does not work when removing a node. I have checked this and I think I found a better solution which handles both scenarios. You can update the scroll range by calling the UpdateScrollRange() method. You can call the method in the NodeExpandedChanged event. So far, I could not find a better place than in this event handler.

private void RadTreeView1_NodeExpandedChanged(object sender, RadTreeViewEventArgs e)
{
    this.radTreeView1.TreeViewElement.Scroller.UpdateScrollRange();
}

Give this approach a try and share if it works for you.

Regards,
Dinko | Tech Support Engineer
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.

Benjamin
Posted on: 15 Jul 2025 06:53

Hi Dinko,

I need to have the feature to recursively collapse part of the tree, so it cannot change the parameter.

Also, as mentioned in my original notes (not part of the bug Report here ?!), the problem also occurs when removing one node from the tree, which is another feature I need ...

A better workaround would consist in being able to recompute the children size correctly without having to collapse all or expand all nodes.

Regards,

Benjamin Foucher

ADMIN
Dinko | Tech Support Engineer
Posted on: 14 Jul 2025 12:22

Hello Benjamin,

Thank you for reporting this behavior. As a workaround, we can ignore collapsing the children in the node from which we call the Collapse() method. This can be done by passing true as a parameter to the method. The default value is false.

this.radTreeView1.Nodes[0].Collapse(true);

Regards,
Dinko | Tech Support Engineer
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.