We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically size TreeViewAdv at runtime

Hi, there. I''m trying to resize a TreeViewAdv control at runtime to contain enough space to display all the nodes in the tree without having to scroll the list. I''ve tried using the Font.GetHeight method and Font.Height property on each node to calculate the amount of space each node takes up in the tree and size the control to that value, but the control ends up being too small to show all the nodes. Is there a way to accomplish what I want to do? Any help would be greatly appreciated. Thanks.

2 Replies

MU Murugan Syncfusion Team July 7, 2006 11:08 PM UTC

Hi Rick, You need to use the ItemHeight property of TreeNodeAdv when calculating the height of the treeview control.Also you need to recalculate height on every tree operations such as expand,collapse etc... I have attached a sample.Please go through that and let me know if you need more assistance. Regards, Murugan

TreeviewSizing.zip


RE Rick Elliott July 10, 2006 12:18 PM UTC

Hi, Murugan. That''s exactly what I was looking for, your example works great. Thanks a lot for the help, I really appreciate it.

Loader.
Live Chat Icon For mobile
Up arrow icon