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
690
Tree Column width auto-adjustment
posted

Hi,

I am having some trouble with setting the column widths in an outlook style treeview control. I would like the column to autoadjust based upon the visible nodes (mainly the longest nodes), but the AutoSizeMode works in conjunction with the PreferredCellSize property, which is obviously unknown due to the nested depths of the tree. I have tried firing up and down the UIElement hierarchy of the node after expansion in order to do this manually, but the UIElements of my childnodes are null. Here's what I want it to do:

+ Node 1         (10)
   + Node 2      (1000)
       + Child 1  (4)

and after expanding Child 1 to...

+ Node 1                          (10)
   + Node 2                       (1000)
       + Child 1                   (4)
           - Sub child item   (1)

And then back again... For the time being, we've been using PerformAutoResize with AllNodesWithDescendants, as it's the only one which allocates enough width as to not truncate the first columns node text.

Is this at all possible?

Thanks, Tom (p.s. this is the last push before release, just tidying things up!)

Parents Reply Children
No Data