Deleting symbol from a diagram - delete key doesn''t work

Thread ID:

Created:

Updated:

Platform:

Replies:

Hello,
The delete key no longer works in my diagram component.
I tried it also with the Custom Symbol Sample, and it doesn''t work here either.
However the diagram builder sample works OK.
In the Custom Symbol Sample, the Diagram_ChildrenChanging event is fired when I insert a symbol, but not when I press the delete key. I.e. it is impossible to delete the symbol.
In the Custom Symbol Sample, the keypress event is not even fired when I press the delete key.
By the way, this is on a W2k machine.
Is this the intended behaviour?
Thanks
Richard

It seems that if a symbol is programmatically created from a symbol model (with CreateSymbol()), then the delete key doesn''t automatically work. Or have I missed something here?
As a "workaround", I do this:
private void diagram1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode == Keys.Delete)
{
diagram1.Delete();
}
}
Is this the recommended solution?

Richard,
Essential Diagram does not have built-in functionality for intercepting the delete key. You will have to handle the Diagram.KeyDown event and call the Diagram.Delete() method if the Delete key is pressed. Your implementation is correct.
The DiagramBuilder sample does not have a handler for the Diagram.KeyDown method only because it has a Delete menu item that specifies the Delete key as the shortcut key, and uses that command handler for invoking the Diagram.Delete() call.
Thanks,
Prakash Surendra
Syncfusion Inc.,
>It seems that if a symbol is programmatically created from a symbol model (with CreateSymbol()), then the delete key doesn''t automatically work. Or have I missed something here?
>
>As a "workaround", I do this:
>
>private void diagram1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
>{
> if(e.KeyCode == Keys.Delete)
> {
> diagram1.Delete();
> }
>}
>Is this the recommended solution?