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

Capture Image Label Click Event of Node

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

5 Replies

RT Ramya Thirugnanam Syncfusion Team 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  



UN Unknown Syncfusion Team 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


RT Ramya Thirugnanam Syncfusion Team 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 



UN Unknown Syncfusion Team 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


RT Ramya Thirugnanam Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon