This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
HI I want to remove all nodes and connections in a diagram surface, but i cannot find a method to accomplish this work. Could anyone tell me how to do this? Thanks Best |
|
|
I have try the following code: ds.Diagram.Nodes.Clear() ds.Diagram.Connections.Clear() however, the diagram surface never notices that the connections/nodes are removed and still draws them. Any suggestions? |
|
|
Hello, Sorry about this. I'd suggest iterating the nodes and connections and call RemoveAt to remove them one by one. If you need to do this in multiple places, you could implement this in a single place that you can reuse. Here is a possible implementation:
The main reason we don't handler Clear() in the product is because the collection changed event handler does not provide the original items before they were cleared, and so we can't iterate the old items to remove the visuals. I've made a note to improve this in a future version. -Jason Fauchelle |
|
|
Thank you very much! -Andy |
|