3 unrelated questions re the WinTree -
1. My root nodes consist of a single value (the child nodes are a grid). Is it possible to have the root node fill the width of the WinTree control so they look more like 'separators' rather than branches?
2. I would like to set the child nodes to appear immediately below the root nodes (so the first column is directly below the label on the root node and only indented by the same amount as the root node - ie just to the right of the expansion indicator) - however I can't seem to be able to set Indent to less than 15 - is there a way to override this and set it to 0, for example?
3. It doesn't seem to matter what I do - I cannot get the columns in the child nodes to auto-size to fill the width of the control. I am creating the root notes and runtime, and the binding a List<T> to each node to create the child node grids. However, the column seem to be some abitrary width despite tree.ColumnSettings.AutoFitcolumns = ResizeAllColumns . What am I missing?
Thanks for your help
Mark
Hi Mark,
1) I'm not sure if there is any easy way to do this. One thing you can try is setting FullRowSelect to true. That might work. If it does not, then I imagine you would need to use a CreationFilter, which would not be easy or simple.
2) I'm not sure I understand exactly what you want here. There is no way to set the Indent less than 15. However, the Indent property is not used if you change the DisplayStyle to WindowsVista (assuming you have a recent version of the tree). Instead, the indentation is determined by the ExpansionIndicatorSize and ExpansionIndicatorPadding. But since this is accounted for on each level, I suspect you will not be able to acheive what you want.
3) I'm not sure why this isn't working. The only thing I can think of is that the total width of your columns is wider than the tree to start with? If you size the columns such that they are bigger than the available area, then I think the AutoFitting might be overriden by this. You might want to try to set the width on each column and make it small enough so that all of the columns fit in the viewable area before setting AutoFitColumns. But I am only guessing here.
Re: 2 - I am using v2007.3 so I don't have the DisplayStyle property. I also can't find ExpansionIndicatorSize / Padding - are they a 2008 thing as well?
I have told the tree not to display any lines (other than the RootLines), and since the child nodes to the root nodes will never have any child nodes for themselves I have also set ShowExpansionIndicators for the child nodes to Never. Ideally, I would like the child nodes to be indented the same as the root node (ie, leave a little gap on the left the same width as the expansion indicators on the root nodes) so you get something like this -
+ This is a root node This is a child node This is another child node- This is a second root node- This is a third root node
Is this possible with v2007.3 ?
markbeeton said:Re: 2 - I am using v2007.3 so I don't have the DisplayStyle property. I also can't find ExpansionIndicatorSize / Padding - are they a 2008 thing as well?
Yes, the WindowsVista display style was added in v2008.1.
But no, I don't think this is possible in any version of the tree.