Hi all!
I posted my question in old topic, but there were no answer, so I decided to create a new one here.
As you write here:
http://blogs.infragistics.com/forums/p/19931/277893.aspx#277893
UltraTree does not provide any support for auto-sizing itself. So, I wanted to know is it still the same, or it already can be autosized using min and max size properties?
Thanks in advance!
Hi Dmitriy,
Our UltraTree does not have property "Autosize", but if you want to make auto resize of your UltraTree you could add for example this piece of code in the events:
private void ultraTree1_AfterExpand(object sender, Infragistics.Win.UltraWinTree.NodeEventArgs e) { ultraTree1.Width = ultraTree1.Width + (e.TreeNode.TextWidth/2); } private void ultraTree1_AfterCollapse(object sender, Infragistics.Win.UltraWinTree.NodeEventArgs e) { ultraTree1.Width = ultraTree1.Width - (e.TreeNode.TextWidth/2); }
private void ultraTree1_AfterExpand(object sender, Infragistics.Win.UltraWinTree.NodeEventArgs e)
{
ultraTree1.Width = ultraTree1.Width + (e.TreeNode.TextWidth/2);
}
private void ultraTree1_AfterCollapse(object sender, Infragistics.Win.UltraWinTree.NodeEventArgs e)
ultraTree1.Width = ultraTree1.Width - (e.TreeNode.TextWidth/2);
Please if you have any questions do not hesitate to ask me
Regards
Hi, Georgi!
Thank you for your help! You pushed me to the right direction of implementing this functionality for my tree. I made not exactly what you've written, but I also used AfterExpand and AfterCollapse events. My tree is not a separate tree, but it is put as a control for dropdown button for ultragrid cell, so it always appears inside the popup form and I need to also resize the form accordingly.
I also used not the TextWidth property to determine the width, but I examined Bounds.Right and Bounds.Bottom of all currently expanded nodes to have real coordinates. And it worked! Thanks a lot!