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

I want to select element sorrounded by a rectangle

Thread ID:





142115 Jan 21,2019 08:07 AM UTC Jan 22,2019 10:14 AM UTC WinForms 5
Tags: Diagram
Blanca Calderon
Asked On January 21, 2019 08:07 AM UTC


I got a rectangle that surrounds some elements (a bitmap, textnode...). But I have to move the rectangle if I want to click those elements. I've tried with ItemToForward but it doesn't work.

Can you help me?

Attachment: Video_1548061299_81ade18b.zip

Naganathan Ganesh Babu [Syncfusion]
Replied On January 21, 2019 11:24 AM UTC

Hi Blanca, 
By default, the diagram control selects the top of the node only while placing the multiple nodes in sample position. So only the surrounded rectangle has selected in your diagram. We suggest you use Node.EditStyle’s “AllowSelect” property to disable surrounded rectangle node and you can select elements which are surrounded by that rectangle node.   
Code example: 
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 100, 100, 100); 
rect.EditStyle.AllowSelect = false; 
Naganathan K G 

Blanca Calderon
Replied On January 21, 2019 11:36 AM UTC

But this doesn't work for me because I want to select rectangle if I need moving it or change its properties (color, size...) 

Naganathan Ganesh Babu [Syncfusion]
Replied On January 21, 2019 12:14 PM UTC

Hi Blanca, 
Could you please confirm us whether your requirement is to select the elements while clicking the element on inside the rectangle node and also select the rectangle (i.e.surrounded rectangle node) to change property (i.e. color,size etc) while clicking the border of the rectangle alone? if so, we will validate your requirement and update you a better solution.  
Naganathan K G 

Blanca Calderon
Replied On January 21, 2019 12:33 PM UTC

My requirement is to select the elements like if all of them were indepent. 

Sometimes I want to select the rectangle, sometimes a bitmapnode (that appear to be inside, but it's only another element in my diagram), sometimes a textnode...now if I want to select a bitmapnode "inside" my rectangle I have to move it and then I can select the element.

I want something like rectangle bring foward and the rest of element bring to front.

Ramya Thirugnanam [Syncfusion]
Replied On January 22, 2019 10:14 AM UTC

Hi Blanca, 
Whether the requirement is to bring the rectangle node to front, then use the BringToFront method in diagram model. Pass the rectangle node as a parameter to the BringToFront method. So, the rectangle node comes to front of all the nodes.  
Please refer to below code snippet for how to use BringToFront method 
To send back the rectangle node, Please use the SendToBack method in diagram model as shown below. 
Ramya T 


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

Live Chat Icon For mobile
Live Chat Icon