Delete issues


I am facing a issue while deleting the nodes from diagram.
The below are the steps that I am performing in my application.

Step 1 : I create 2 nodes and link them and it looks like below :

Step 2: I add 2 more nodes and link them and also I add another node I don’t link it

Step 3: I do Ctrl + A to select all the nodes and links and I press Delete key. I expect all the selected nodes to be deleted at a shot. But it doesn’t.

First press of Delete Key:

Second Press of Delete Key:

When I press the delete key for the third time all the nodes were deleted.
Also this is not consistent. When I select the nodes using rubberband zoom the deletion sequence is different.

Any suggestions to delete the selected nodes at once ?

Are there any errors or warnings in the output window while debugging?

Did you set Diagram.MaximumSelectionCount to 1?

Have you implemented any event handlers, and if so, which ones? Do any of those handlers modify the diagram, and if so, how?

There are no errors or warnings related to delete but there warnings were related to the converters that we have used.

And No we haven’t set MaxSelectionCount to 1. When I do rubberband selection or Ctrl A, All the nodes and links get highlighted.

Also we have event handlers like SelectionChanged, DiagramLayoutCompleted, DiagramLinkDrawn,LinkRelinked
but none of them are related to deleting of any nodes or links.

And the SelectionChanged event handler does not ever affect the selection collection, Diagram.SelectedParts, either directly or indirectly?

Yeah. In selectionChanged event I was updating the category of the link and also updating the visibility of an icon on node.

But now I have commented all my code inside SelectionChanged event. Still the Delete behaves the same way as explained earlier.

Changing the category of a Part in a SelectionChanged event will remove that Part (thereby changing the selection collection) and then add a new replacement Part using the new template.

But if you have disabled the SelectionChanged event handler, I don’t know what the problem might be. Surely you do not encounter this problem with any of the GoWpfDemo samples.

I tried replicating the same in the demo applications. Explored few demo application and I could replicate the similar behavior in “Circular Layout”, “State Chart”.

When I do Ctrl A and press delete it deletes all the nodes but when I do rubber band selection it doesn’t delete all nodes though I have selected all nodes.

This is the issue that I am facing in my application. Not consistent though.

Now that’s downright weird. I’ve never heard of that behavior before (assuming that Nodes could be selected and deleted, of course).

And I cannot reproduce the behavior with either the Circular Layout sample or the State Chart sample, using either Ctrl-A SelectAll or rubberband-select (DragSelectingTool).

If the problem were just in DragSelectingTool, perhaps the problem would be related to the inability to select all of the nodes. Maybe because the nodes are bigger than they seem, so the rubberband box doesn’t actually surround the whole of each node. But that would not explain why Ctrl-A Delete doesn’t work for you reliably.

Well, As I said its not consistent. Here are the screenshots from Demo application for State Chart:

Step 1: I have pressed Ctrl A:

Step 2: First Delete:

Step 3: Second Delete:

Step 4: Third Delete:

Step 5: Fourth Delete is Deleting the last node left.

Now if I do Rubber band select and delete its deleting all nodes at once. The delete behavior is not consistent.

I cannot explain that behavior. As I said (and as I just reconfirmed) in the unmodified GoWpfDemo State Chart sample, if I type Ctrl-A Delete, everything is selected and then everything is deleted.

Normally any errors in bindings will not affect the rest of the application, other than that caused by the failure to transfer the binding value. I’m wondering if maybe those binding errors that you are seeing are somehow affecting selection or deleting. Not a likely cause, but I don’t know what else to suggest.

Are you sure the DLL that you are using was compiled for the same .NET version that your app is targeting?

Do you see the same behavior when running the app on a different machine?

I observed one thing.

When I run the demo application from bin (i.e. exe) and I didn’t see this issue. But when I run the demo application from Visual Studio i.e. by changing the framework to 4.5 it seems reproducible.

I tried to open the solution relevant to v4.6 ( i.e. GoWpfDemo46.sln) in VS 2013 it gives me a pop saying either I have to downgrade to 4.5 or to install 4.6. Where as I already have v4.6.1 installed. I am not sure if you can provide me with any GoXam dll relevant for 4.6.1?

Could this be the reason for this kind of behavior ?

4.6.0 and 4.6.1 should be compatible.

No, I don’t know that this is the cause of the problem that you are seeing, but I don’t know what is causing the problem, so I was just guessing.

Guess I found the issue.

Earlier we were using GoWPF dll of version and we had this issue.
In the demo application that I downloaded from your website has GoWpf dll of version

Replaced the latest dll in my application and the issue is resolved.

Good. I’m sorry that possibility did not occur to me.