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

Node add and Node delete events

Version of essential suite is going to be released in the next couple of days, will it have any node added and node deleted events in it, or will I need to code these manually?

7 Replies

PS Prakash S Syncfusion Team July 7, 2004 09:05 PM UTC

Hi Richard, The Diagram.Model.ChildrenChangeComplete event can be used to determine whether a node has been added to the diagram. The event''s NodeCollection.EventArgs event argument provides information about the type of change and the affected nodes. As for node deletion, we have this filed as a feature request and we will do our best to add the feature for the next public update of Essential Diagram. For the time being, please workaround this limitation by using the Controller.SelectionList as described in the other post to allow/pre-empt the delete operation -http://www.syncfusion.com/Support/forums/message.aspx?MessageID=15569earlier . Prakash Syncfusion

AD Administrator Syncfusion Team July 9, 2004 07:17 PM UTC

A provision has been added for being notified of node remove/cut commands & cancelling them if necessary: Starting with the next update of Essential Diagram the Diagram.Model.ChildrenChanging event will function as a true cancelable event. In the case of a remove command, the ChildrenChanging event will be generated before the node is actually removed from the diagram, and the event arguments can be examined to determine the type of change(Remove or Insert) and the affected node. The event arg''s Cancel property may then be used to pre-empt the node deletion. Prakash Syncfusion, Inc

RI Rich July 9, 2004 07:39 PM UTC

Thanks Prakash, But I tried the following private void diagramComponent_ChildrenChangeComplete(object sender, Syncfusion.Windows.Forms.Diagram.NodeCollection.EventArgs evtArgs) { evtArgs. } but evtArgs does not expose any functionality (ie. no lists of functions, events, properties when you type "evtArgs."). I also cannot find any doco to support this area, so currently it is of no use. If the answer is not straight forward, could you please provide some examples. Thanks

AD Administrator Syncfusion Team July 9, 2004 08:52 PM UTC

Richard, The event argument for the ChildrenChanging/ChildrenChangeComplete events is of the Syncfusion.Windows.Forms.Diagram.NodeCollection.EventArgs type. The EventArgs class is nested within the Diagram.NodeCollection class and this nested nature of the class appears to be interfering with the VS.NET intellisense support. We will try to get this sorted. The following snippet shows an implementation for the Diagram.ChildrenChangeComplete event handler that verifies whether a new Symbol has been added and if so traces a message. private void diagramComponent_ChildrenChangeComplete(object sender, Syncfusion.Windows.Forms.Diagram.NodeCollection.EventArgs evtArgs) { if((evtArgs.ChangeType == CollectionEx.ChangeType.Insert) && (evtArgs.Node is Symbol)) Trace.WriteLine("New Symbol added"); } The other properties of interest in the NodeCollection.EventArgs type are EventArgs.Nodes that returns an array of Node objects when more than one node is affected by the event. The CollectionEx.ChangeType enumeration is as defined below, /// /// Identifies a type of change made to a collection. /// public enum ChangeType { /// /// One or more items were inserted into the collection /// Insert, /// /// One or more items were removed from the collection /// Remove, /// /// All of the items were removed from the collection /// Clear, /// /// One of the items in the collection was modified /// Set } My apologies for this inconvenience. We will definitely work on improving the documentation in forthcoming versions of the product. Prakash Syncfusion, Inc

AD Administrator Syncfusion Team May 6, 2005 05:40 PM UTC

I''m glad this is still on the message board. Being able to determine when a node is added and get that node, is what I needed to do.

AD Administrator Syncfusion Team May 6, 2005 05:45 PM UTC

And now that I look in the KB I see it there too.

AD Administrator Syncfusion Team May 6, 2005 07:11 PM UTC

Hello! The problem with the intellisense has been addressed in the latest 3.2 release of Essential Diagram. The nested structure has been removed from all the collection classes and related events, and VS.NET intellisense and the Class Reference documentation now correctly pick up the types. Once again, our apologies for the inconvenience that this issue has caused. Regards, Prakash Surendra Syncfusion Inc.,

Live Chat Icon For mobile
Up arrow icon