Hi,
I want to save/load the expanded status of a UltraTree, so firstly I use SaveAsXml to save the UltraTree, but I got an exception saying that:
"Type *** in Assembly *** is not marked as serializable."
The specified type is a custom object in my code, and is set to the Tag of each tree node. But actually I don't want to save the tag, what I need is just serializing the expanded status of each tree node.
How can I solve the problem? Thanks.
One solution would be to recursively iterate all Nodes collections and clear the Tag property of each node before saving the layout. ANother would be to decorate your custom class with the Serializable attribute, and add a deserialization constructor...you don't necessarily have to bother implementing serialization support for the class, but that should prevent the error.