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

Updating a node inside a group doesn't update Group's handle size

Thread ID:

Created:

Updated:

Platform:

Replies:

123808 Apr 22,2016 11:54 AM Apr 25,2016 08:04 AM Windows Forms 1
loading
Tags: Diagram
Sergio
Asked On April 22, 2016 11:54 AM

Good morning,

I'm having  problem in my implementation. The context goes like this:

I have crated an extension to the group node for my implementation, that contains a BitMapNode, and a Rectangle node (that will have variable size and text as a label) and other components. When i update the Rectangle's text the size also varies but when I select it the node's handles do not show an update to the bounds. I have tried a lot of the update methods but there is no success. I am having an Overflow exception in another part and there is the possibility that this might be the cause.

here is the code where i change the text's content (this reffers to my custom Group class).

public void ChangeLabel(string txt)
       {
           if (txt != null && txt != string.Empty)
           {
               this.model.BeginUpdate();
               //if (this.model.Nodes.Contains(this)) this.model.RemoveChild(this);
               
               var sizeSpace = ((txt.ToArray<char>()).Count()) * 8;
               if (this.Nodes.Contains(this.StepnameLabel)) this.RemoveChild(this.StepnameLabel);
               this.StepnameLabel = new Syncfusion.Windows.Forms.Diagram.Rectangle(BmpNode.PinPoint.X - sizeSpace / 2, BmpNode.PinPoint.Y + 30, sizeSpace, 15, MeasureUnits.Pixel);
 
               var color = Color.Transparent;
 
               var label = new Syncfusion.Windows.Forms.Diagram.Label(StepnameLabel, txt);
 
               label.FontStyle.Family = "Segoe UI";
               this.StepnameLabel.Labels.Add(label);
               StepnameLabel.FillStyle.Color = color;
               StepnameLabel.LineStyle.LineColor = color;
               StepnameLabel.Visible = true;
               StepnameLabel.EditStyle.AllowSelect = false;
               this.AppendChild(this.StepnameLabel);
 
               
                   this.Name = "something";
              
 
               
 
               //this.model.AppendChild(this);
               this.model.EndUpdate();
               
           }
}

I upload images to display the problem.

Thank you for your quick response.






Attachment: graphicbug_d810adec.zip

Devaraj Sekar [Syncfusion]
Replied On April 25, 2016 08:04 AM

Hi Sergio, 
Thanks for using Syncfusion Product. 
Please use group’s “UpdateCompositeBounds()” method to achieve your requirement. 
 
Code Snippet: 
public void ChangeLabel(string txt) 
{ 
…. 
this.AppendChild(this.StepnameLabel); 
// To Update Group’s Bounds. 
this.UpdateCompositeBounds(); 
}  

Regards, 
Devaraj. S. 


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.

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.

;