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.
Unfortunately, activation email could not send to your email. Please try again.

Getting an event when dropping a Symbol from a PaletteGroupView

Thread ID:

Created:

Updated:

Platform:

Replies:

89312 Aug 21,2009 11:03 AM Sep 3,2009 02:36 AM Windows Forms 3
loading
Tags: Diagram
Stephane Guerillot
Asked On August 21, 2009 11:03 AM

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.

Mano J [Syncfusion]
Replied On August 25, 2009 06:01 AM

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

Joseph
Replied On September 2, 2009 11:56 AM

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

Gowri Manohari D [Syncfusion]
Replied On September 3, 2009 02:36 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;