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

Adding or deleting Diagram symbol.

Hi,

how do i determine when a new symbol or shape has been added, deleted or changed from one parent to another parent in syncfusion.winforms.diagram.

please provide some example.



Thanks and regards
Venkat.

1 Reply

VR Varalakshmi R.S Syncfusion Team August 9, 2010 12:30 PM UTC

Hi Venket,

Thank you for your interest in syncfusion products.

Adding, deleting or changing a new symbol or shape from one parent to another parent in syncfusion.winforms.diagram can be determine by using “NodeCollectionChanging” event which triggered when the node collection is edited. Please refer the following code snippet to achieve this.



private void Form1_Load(object sender, EventArgs e)
{

((DiagramViewerEventSink)diagramWeb1.EventSink).NodeCollectionChanged += new CollectionExEventHandler(Form1_NodeCollectionChanged)((DiagramViewerEventSink)diagramWeb1.EventSink).NodeCollectionChanging += new CollectionExEventHandler(Form1_NodeCollectionChanging);


RectangleF rect = new RectangleF(100, 100, 100, 100);
RichTextNode richText = new RichTextNode("", rect);
richText.Text = "Rich text box";

NodeCollection nodeStack = new NodeCollection();
nodeStack.Add(richText);
MessageBox.Show(nodeStack.Count.ToString());

}

private void Form1_NodeCollectionChanging(CollectionExEventArgs e)
{
MessageBox.Show("NodeCollectionChanging event fired");
}



Please refer the following documentation link to know more about NodeCollection events.
http://help.syncfusion.com/ug_83/User%20Interface/ASP.NET/Diagram/Documents/nodecollectionevents.htm

Please let us know if there are any concerns.

Regards,
Varalakshmi.R.S

Loader.
Live Chat Icon For mobile
Up arrow icon