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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Capture Image Label Click Event of Node

Thread ID:

Created:

Updated:

Platform:

Replies:

142670 Feb 14,2019 11:58 AM UTC Feb 18,2019 11:05 AM UTC WinForms 5
loading
Tags: Diagram
Unknown
Asked On February 14, 2019 11:58 AM UTC

Hi,

Currently We are evaluating Syncfusion for winform flow diagram in that we can not capture perticular image label click event of node.If you have any demo sample of  this functionality in Winform Please provide us demo sample or any custom changes required for this functionality please help us.

Thanks In Advance


Thanks & Regards,
Sumit

Ramya Thirugnanam [Syncfusion]
Replied On February 14, 2019 12:44 PM UTC

Hi Sumit, 
 
Thanks for contacting Syncfusion support. 
 
Requirement: need label and node click event 
 
We have support to achieve your requirement by using the below events. Please refer to the code example and help documentation link as below. 
 
Code example: 
//Registering the Node click event... 
diagram1.EventSink.NodeClick += EventSink_NodeClick; 
 
//Registering the Label text changed event... 
diagram1.Controller.InPlaceEditor.LabelTextChanged += InPlaceEditor_LabelTextChanged; 
 
  private void InPlaceEditor_LabelTextChanged(object sender, EventArgs e) 
        { 
            ///Write your logic here... 
        } 
 
        private void EventSink_NodeClick(NodeMouseEventArgs evtArgs) 
        { 
            ///Write your logic here... 
        } 
 
 
Regards,  
Ramya T  


Unknown
Replied On February 14, 2019 01:27 PM UTC

Hi Ramya,

Thanks for update

Actually we want capture actual node label click event not node click event only suppose when i click any label in node i want to access that particular label info in that event.

Info Like Label Name of that particular label click of node.


Thanks & Regards,
Sumit

Ramya Thirugnanam [Syncfusion]
Replied On February 15, 2019 07:01 AM UTC

Hi Sumit,  
 
We have created a sample to display node label info when click on node label. By using the node click , We can validate and get the label based on the mouse hit position. 
 
Please find the sample in the below link 
 
 
Regards, 
Ramya T 


Unknown
Replied On February 18, 2019 06:10 AM UTC

Hi Ramya,

Thanks for update

In Above Sample of code we can access only center position label click event.when i click on another position of  label.click event not capturing 

Thanks & Regards,
Sumit

Ramya Thirugnanam [Syncfusion]
Replied On February 18, 2019 11:05 AM UTC

Hi Sumit, 
 
The diagram mouse up event triggers when node label is outside the node and if click on node label. In that event, get node bounds by using the GetNodeBounds and we can validate whether the bounds intersects with current mouse location. Using findLabel method, we can find the respective label based on the intersected node. 
 
Please find below code example for how to use the MouseUp event. 
 
diagram1.MouseUp += Diagram1_MouseUp; 
 
private void Diagram1_MouseUp(object sender, MouseEventArgs e) 
        { 
            Syncfusion.Windows.Forms.Diagram.Node labelNode = null; 
            foreach (Node node in diagram1.Model.Nodes) 
            { 
                RectangleF bounds = node.GetNodeBounds(true, false); 
                if (bounds.Contains(diagram1.Controller.MouseLocation)) 
                { 
                    labelNode = node; 
                    break; 
                } 
            } 
             
            Syncfusion.Windows.Forms.Diagram.Label label = findLabel(labelNode); 
            MessageBox.Show(label.Text); 
        } 
 
We have prepared a sample for your requirement. Please find the sample in below link. 
 
 
Regards, 
Ramya T 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;