Hello:
I am using an UltraWinTree and the Outlook Express style. Everything is cool, except, when i add the node, and set the left image, I do not see that image.
I have to do it like this: (this is a for loop that is looping through another tree to write the nodes the column based tree, like windows explorer)
worknode = utvPVDetails.Nodes.Add(t.Key, t.Text);
worknode.Cells[0].Appearance.Image = ilProject.Images[(Int32)t.LeftImages[0]];
Why can't I just do this:
worknode.LeftImages.Add((Int32)t.LeftImages[0]);
So that I can utilize the imagelist I have associated with this tree?
Note that you don't necessarily have to switch the control you are using; UltraTree also extends a setting for the ViewStyle property, 'Grid', which is ideally suited for presenting flat data as well. In your case I think you would simply change the line of code that sets the ViewStyle to 'OutlookExpress' to 'Grid' instead.
I was thinking the listview as well except I went with the Tree because I am displaying the contents of a tree to the left (like Windows Explorer) and I basically use all the same methods from the left hand tree to handle nodes on the right.
Anyway, I will give what you said a shot, otherwise I can just live with the space for now and look at the listview moving forward.
Thanks for all the help.
Hi,
The space has to be reserved, because otherwise child nodes would look just like parent nodes and you would not be able to tell the difference.
It sounds like you don't have any child nodes, though. If that's the case, the UltraWinTree is an odd choice. You might be better off using UltraListView instead.
There's a property on the ColumnSet called ExpansionIndicatorColumn which determines which column in the tree shows the expansion indicator. So maybe you could set it to a different column. I'm not sure if this will work, but you might want to try adding an unbound column, hiding it, and using that column for the ExpansionIndicatorColumn.
Is there a way to not have the control reserve that space? (Like you do for the image)
Maybe that space is for the expansion indicator. Is Item the first text column in your tree? If so, it will default to showing the expansion indicator and if the nodes here just don't happen to have any child nodes, that might be why the space is empty.