Currently my application adds my custom symbol to the diagram from the palette. This symbol contains 2 labels which I added in Symbol Designer.
My goal is to add my own labels to the symbol when it has been added to the diagram. Currently I have had no joy so instead am trying to clear the existing labels. When the user clicks a button then the following code is invoked:
private void btnAddLabel_Click(object sender, System.EventArgs e)
DiagramForm frm = (DiagramForm)ActiveMdiChild;
foreach (Symbol sym in frm.Diagram.Model.Nodes)
foreach (Label lbl in sym.Labels)
However, the labels are not removed from the screen. When I inspect the Labels property of the Symbol there are no labels.
Should I be calling another method to refresh the diagram? I have tried each of the following afterwards but to no avail.
ADAdministrator Syncfusion Team September 17, 2004 12:31 PM
You should use the Symbol''s Remove() or RemoveAt() Method to remove the labels from the symbol.
Here is a code snippet which demonstrates how you can remove labels of a custom symbol: MySymbol(s) in a Diagram:
//Remove Lables in MySymbol
foreach (MySymbol sym in this.diagram1.Model.Nodes)
for (int i=sym.Labels.Count-1; i>=0; i--)