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.

On node click "NodeClick" event get executed twice.

Thread ID:

Created:

Updated:

Platform:

Replies:

30289 Jun 15,2005 08:31 AM Jun 20,2005 02:01 PM Windows Forms 5
loading
Tags: Diagram
sudarshan.vatturkar
Asked On June 15, 2005 08:31 AM

Dear I was trying to capture single node click event, but when I click any node of a diagram, "diagram1_NodeClick" method executes twice. Please let me know solution for the same. Note: Syncfusion Essential suite ver is: 3.2.1.0 Sample Code: this.diagram1.NodeClick += new NodeMouseEventHandler(diagram1_NodeClick); private void diagram1_NodeClick(object sender, NodeMouseEventArgs evtArgs) { MessageBox.Show("Node Name:" + ((MapNode)evtArgs.Node).Name + " longinfo:" + ((MapNode)evtArgs.Node).NodeInfo); }

sudarshan.vatturkar
Replied On June 15, 2005 08:44 AM

Dear On button click if I select activate tool as a “customsymbol” and if user place the node anywhere in a diagram, it raises the "NodeClick" event. How I can restrict raising of NodeClick event? Thanks Sudarshan

Administrator [Syncfusion]
Replied On June 16, 2005 06:25 PM

Hi Sudarshan, The Diagram.NodeClick event will be generated once for each node in the diagram that lies under the point that was clicked on. Hence when clicking complex nodes such as Symbols you will encounter multiple occurences of the NodeClick click. For instance when clicking a Symbol made up of a Rectangle shape node, the NodeClick event will be fired once with the Symbol as the NodeMouseEventArgs.Node param, and a second time with the symbol''s child Rectangle node as the Node param. Examining the type of the event argument''s Node type will let you filter the event depending on the node that you are interested in. Regards Prakash Surendra Syncfusion Inc.,

Administrator [Syncfusion]
Replied On June 16, 2005 07:01 PM

Sudarshan, Thank you for pointing out the issue with the NodeClick event being generated when using the InsertSymbolTool. Looking into this problem made us realize that the InsertSymbolTool/InsertNodeTool should ideally create and insert the diagram node in response to the MouseUp event and not the MouseDown event. We have made the necessary changes and starting with the next update of Essential Diagram, the NodeClick event will not be generated when inserting a new node. For the time being you can workaround the problem by handling the event only if the Diagram SelectTool is active when the event is being fired. The SelectTool will be active when the node is directly clicked on. The following code shows the implementation, private void diagram_NodeClick(object sender, Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs) { Syncfusion.Windows.Forms.Diagram.Tool selecttool = this.diagram.Controller.GetTool("SelectTool"); if(selecttool.Active == true) { System.Diagnostics.Trace.WriteLine("Node Click"); } } Prakash Surendra Syncfusion Inc.,

sudarshan.vatturkar
Replied On June 17, 2005 06:19 AM

Dear Prakash Thanks for your reply, my symbol node is not a complex node it only uses rectangle. Still I got two events on node click. I use default lable proeprty for showing in-line text inside node. Thnaks Sudarshan >Hi Sudarshan, > >The Diagram.NodeClick event will be generated once for each node in the diagram that lies under the point that was clicked on. Hence when clicking complex nodes such as Symbols you will encounter multiple occurences of the NodeClick click. For instance when clicking a Symbol made up of a Rectangle shape node, the NodeClick event will be fired once with the Symbol as the NodeMouseEventArgs.Node param, and a second time with the symbol''s child Rectangle node as the Node param. Examining the type of the event argument''s Node type will let you filter the event depending on the node that you are interested in. > >Regards >Prakash Surendra >Syncfusion Inc.,

Administrator [Syncfusion]
Replied On June 20, 2005 02:01 PM

Sudarshan, An Essential Diagram Symbol is a complex type ie., it can and will contain child nodes that provide its geometry. A Symbol composed of a Rectangle will still result in multiple occurences of the NodeClick event as the event will be generated for the Symbol node once, and for the child Rectangle shape the second time around. This is the correct behavior. If your intention is to just listen for events on the contained shape, an option would be to filter out the event handling code if the NodeEventArgs.Node member is of a Symbol type. Regards, Prakash Surendra Syncfusion Inc.,

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.

;