Hi,
I have an issue with autosizing of UltraTree.
I have object with several properties bound to DataSource of some bindingSource. This binding source is bound to DataSource of UltraTree. In design mode I made all properties but one invisible. The tree generates just fine and looks simple:
- Text
When I use ViewStyle as Outlook Express and set:
ColumnSettings.AutoFitColumns = AutoFitColumns.ResizeAllColumns
the Tree looks as I expect and its width is expanded to parent Control.
Problem is with ViewStyle = Grid.
The tree is generated ok, but the width of the column is set to some default value. I could not find any property that says to column in node to expand so all text in cells are shown to the user.
Anyway I found some samples how to fix it with:
UltraTreeNodeColumn.PerformAutoResize();
And here comes the problem:
Now my tree looks fine, shows even longer texts, but also it shows Label. So I set:
UltraTreeColumnSet.LabelPosition = NodeLayoutLabelPosition.None;
And with this all resizing is gone. I was trying to set up various properties with various values but with no success.
Is there a way to do automatic column sizing in UltraTree with ViewStyle=Grid and no Labels displayed?
This sounds like a bug that was fixed a while back. You should dowload the latest service release and see if the problem is rectified, and if it isn't, log an incident or repost here with a sample project and we'll take a closer look.
Thanks for reply. I have tried service release but with no impact on tree behavior.
When I set LabelPosition = None PerformAutoResize is not working.
I have also noticed, that setting Column.LayoutInfo.PreferredCellSize does nothing, but using Column.LayoutInfo.PreferredLabelSize does the work.
And last thing, in OutlookExpress style everything is fine, but how can I set Image to last (not expandabel) node? There is default image (Collapsed), but when I click, image disappears. I was trying to put an image here but with no luck (Node.Cells[0].Appearance.Image = 0 and some variations). Code worked fine for any other node. I was able to put an image only into a cell. Laso LeftImages, RightImages did not work at all :(
Is it possible to add image to not expandable node in outlookexpress mode (so it is in line with collapsed and expanded node)?