Hi, everyone
I have two UltraTree's in my UI. The 2nd one is just a copy (I did a ctrl-c as to have the same properties as the 1st). The 1st tree doesn't require me to call any beginupdate or endupdate function calls whenever I make changes to the nodes (for example if i change a node image) for the tree to update, but the 2nd copied Tree does require me to call beginupdate and endupdate whenever I make changes to get the same functionality as the 1st Tree. I've looked at the properties and they look the same. Any idea why the 2nd tree would act differently than the 1st tree since I just did a copy? Is there a property I should look at on the 2nd tree? The property I thought that would affect this is UpdateMode, but both Trees have it set to "OnActiveNodeChangeOrLostFocus"... They're both docked using the UltraDockManager if that has anything to do with it...any help much appreciated.
Can you post the exact code you are using to cause a change? How are you changing the image, for example?
You shouldn't have to do anything, but I am wondering if by copying the tree you have somehow got your two trees sharing appearances or something like that.
I'm just doing UltraTreeNode.Override.NodeAppearance.Image = bitmap for both trees...Also for background, basically what I'm doing is trying to get the nodes on Tree1 and the nodes on Tree2 to update with the same image as they have the same key values. I've also got the Tag properties of the UltraTreeNodes set to a user defined class (I think this is where the problem lies....)
I noticed that when I load the settings for the two UltraTrees initially, the images update correctly, however I have to re-point the Tag properties in UltraTree2 to the same objects in UltraTree1 as when I'm saving the settings per tree, the objects are disjoint (that's my thought anyway). It's when after I re-hook the Tag to the correct objects I'm getting this drawing behavior...It's as if something in the Tag is causing it not to draw right away, but I need the Tag property to point to the same object from both trees. After I re-hook the Tag, the application works fine, but the drawing doesn't happen.
I've also tried making a completely new tree without copying and I get the same behavior...it's after I set the Tag property of the nodes it stops redrawing automatically.
Thanks for your help, Mike.
I'm afraid you lost me. The tag property should not have any effect on the image of a node. Unless maybe you are basing the image on the tag.
Also, you indicated in your original post that you are copying the tree at design-time. But you can't be setting the tag of a node to a custom object at design-time. So are you copying the nodes at run-time? Is your custom object serializable?
Here's something odd I noticed...When I start my app and I have it load the settings files for both of my trees, it draws the images without having me call beginupdate and endupdate. However, if I reload the settings files myself after the app has loaded the file, the 2nd tree doesn't redraw by itself. Both auto loading and manual loading run through the same code...is there any reason why a "fresh" tree would work correctly upon application startup, but not if I load the settings file myself?
I'm afraid I really can't explain it. Your best bet would be to create a small sample project that demonstrates the issue and Submit an incident to Infragistics Developer Support so they can take a look and figure out what's happening.
Sorry for all of the extra posts, Mike, but my last "solution" wasn't one at all...Finally I narrowed it down to the file settings being saved/loaded. So what I'm having to do now is save the UltraTree via the SaveAsBinary(stream) and then reload via LoadFromBinary(stream) methods. This fixes my issues.