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

Diagram click

Thread ID:





106469 Jan 9,2013 08:11 AM UTC Jan 18,2013 07:26 AM UTC ASP.NET Web Forms (Classic) 1
Tags: DiagramWebControl
Kamel Gazzah
Asked On January 9, 2013 08:11 AM UTC

I have a diagram displayed in a web form
I want to let the user click on a particular item in the diagram (a round rectangle for example) and then the program should detect this item properties (Label for example)  to do a further treatment
How can I do that ?

Amsath Ali M [Syncfusion]
Replied On January 18, 2013 07:26 AM UTC

Hi kamel,


Thanks for your interest in Syncfusion products.


We suggest you to use either the DiagramWebControl’s  client side ‘OnClientNodeClick or the server side OnNodeClick” events to get the clicked node. Please refer the below code snippet to achieve your requirement.


Here is the code:



<script type="text/javascript">

        function NodeClick(oData) {

            var Labels = oData.Node.Labels;

            for (var i = 0; i < Labels.length; i++) {

                if (Labels[i].Text != "")

                { alert("Clicked Node label's Text:"+" " +Labels[i].Text); }







protected void Page_Load(object sender, EventArgs e)


            if (!IsPostBack)



                DiagramWebControl1.ClientObjectId = "_sfDiagramWebControl";


                Rectangle nodeA = new Rectangle(100, 100, 100, 70);

                nodeA.Name = "NodeA";

                nodeA.Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(nodeA, "Rectangle"));



                Ellipse nodeB = new Ellipse(300, 100, 100, 70);

                nodeB.Name = "NodeB";

                nodeB.Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(nodeB, "Ellipse"));






Please let us know if you have any queries.



Amsath Ali. M




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

or the page will be automatically redirected to 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