Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1935
UltraWinTree - Horizontal Scroll and Tree Width
posted

Hi

i want to avoid horizontal scroll in the tree,  from many posts in the form i understand that there is no some sort of "autosize" property 

i found this at on few of the posts 

at Expand Event : 

ultraTree1.Width = ultraTree1.Width + (e.TreeNode.TextWidth/2);

it doesn't make much sense to me , adding the TextWidth/2 of the clicked node, what if his child node has a long name, it will not work. this is some sort of average that may work generically, i dont want to speak for everyone but for me it just does not work well.  it either sets the width too much too less.

i was thinking of changing the width of tree control after each expand incase there is" horizontal ScollBar Scrolling availability", meaning something like

while (ultraTree1.HorizontalScrollBar == true)  // or ultraTree1.Scrollbars == Scrollbars.Vertical;

{

ultraTree1.Width ++;

ultraTree1.Refresh();

}

however i have not found the appropriate property to look at. also i couldn't find something like ScrollPosition for horizontal. for vertical i read that it can be set using the TopNode property, but i need the horizontal. 

can this be done?

Parents Reply Children