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
close icon

I want to select element sorrounded by a rectangle

Hi,

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

5 Replies

NG Naganathan Ganesh Babu Syncfusion Team 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: 
 
[C#] 
 
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 100, 100, 100); 
rect.EditStyle.AllowSelect = false; 
 
Regards, 
 
Naganathan K G 



BC Blanca Calderon 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...) 


NG Naganathan Ganesh Babu Syncfusion Team 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.  
 
Regards, 
 
Naganathan K G 



BC Blanca Calderon 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.


RT Ramya Thirugnanam Syncfusion Team 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 
 
diagram1.Model.BringToFront(rectangle); 
 
To send back the rectangle node, Please use the SendToBack method in diagram model as shown below. 
diagram1.Model.SendToBack(rectangle); 
 
 
Regards 
Ramya T 


Loader.
Live Chat Icon For mobile
Up arrow icon