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?
LeftImages and RightImages only apply to standard-style nodes. They will not work with grid or outlookexpress style.
What you probably need to do is add an unbound column to your ColumnSet and set it's DataType to Image and display your images that way.
Well, what is getting me is that on the first column , there seems to be a space reserved for an image...I am not sure how to then left justify this? Keep in mind, I am adding an image as I stated with
ImageAlign and TextAlign are set to left.
Hi,
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.
Is there a way to not have the control reserve that space? (Like you do for the image)
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.
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.