We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Getting an event when dropping a Symbol from a PaletteGroupView

This is my last question, thank you for your patience.

I've got a Diagram on the left side of my application (SyncFusion.Windows.Forms.Diagram.Controls.Diagram), and a PaletteGroupView (SyncFusion.Windows.Forms.Diagral.Controls.PaletteGroupView) on the right side. The Palette is dynamically filled with Nodes (BitmapNode to be precise), but the Diagram will only contain Rectangles (Syncfusion.Windows.Forms.Diagram.Rectangle).
I would like, when I drag&drop a Symbol from the Palette to the Diagram, to raise an event allowing me to delete the BitmapNode, and creating a Rectangle at the same place.
But it seems that the drop isn't done by a Tool, and I can't catch a MouseUp event or something approaching. The best I could do is to overrid the Clone function in the BitmapNode class. But I still need an event when the Node is dropped. Where could I find it ?

By the way, is there an event I could catch just before dropping a Node on the Diagram ? (to avoid Nodes intersecting each other for example)

Thanks again for your help.

3 Replies

MJ Mano J Syncfusion Team August 25, 2009 10:01 AM UTC

Hi Stephane,

Did you try NodeDropFromPalette event?. This event will trigger when you drag and drop a node from the palette to diagram web control.


DiagramWebControl1.NodeDropFromPalette += new Syncfusion.Web.UI.WebControls.Diagram.NodeDropFromPaletteEventHandler(DiagramWebControl1_NodeDropFromPalette);

void DiagramWebControl1_NodeDropFromPalette(object sender, Syncfusion.Web.UI.WebControls.Diagram.NodeDropFromPaletteEventArgs e)
{
// do something here.
}


Please let me know if you have any questions.

Best Regards,
Mano


JO Joseph September 2, 2009 03:56 PM UTC

Is there any event for diagram to capture the object being droped on it in Windows application?


GM Gowri Manohari D Syncfusion Team September 3, 2009 06:36 AM UTC

Hi Joseph,

Diagram does not have direct event for your requirement. We can achieve it through some indirect method. Please refer the below code snippet. You can use either DragDrop event or NodeCollectionChanged event.

diagram1.Model.EventSink.NodeCollectionChanged+=new CollectionExEventHandler(EventSink_NodeCollectionChanged);
void EventSink_NodeCollectionChanged(CollectionExEventArgs e)
{
// Do something here
}

diagram1.DragDrop+=new DragEventHandler(diagram1_DragDrop);
void diagram1_DragDrop(object sender, DragEventArgs e)
{
// Do something here
}

Regards,
Gowri

Loader.
Live Chat Icon For mobile
Up arrow icon