Delete selected node


I have different items with different templates that user can drop into the diagram from a palette.
One is a simple TextBlock and another is a kind of table as described in the 'Find parent container' post (
I have a button in the page that only calls a function to delete the selected nodes in this way:
function DeleteSelection() { myDiagram.allowDelete = true; myDiagram.commandHandler.deleteSelection(); myDiagram.allowDelete = false; };
The strange thing is that all nodes can be deleted but not the node with the table template and I cannot find why.

I don’t know – CommandHandler.deleteSelection() calls Diagram.removeParts on a collection of all selected Parts for which Part.canDelete() is true, so it really doesn’t care about the type of the Part nor any template. Unless the template sets or binds Part.deletable to false?

Check to see if there are any errors or messages in the console.


thanks for the explaination. From the console I saw that (I don't know why) the part.deletable was equals to false.
Setting that to true solved the question.
Thanks for your help and sorry for the stupid question.