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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamically size TreeViewAdv at runtime

Thread ID:





46203 Jul 7,2006 06:40 PM UTC Jul 10,2006 12:18 PM UTC WinForms 2
Tags: Tools
Rick Elliott
Asked On July 7, 2006 06:40 PM UTC

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.

Murugan [Syncfusion]
Replied On 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


Rick Elliott
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon