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

Request - SelectionChangedComplete

I would like to do something with a selected node once all nodes have been selected. Its not too important, and I have a workaround, but I thought I would suggest it anyways. My workaround is to capture the mouse up event and then grab one of the selected nodes that way.

4 Replies

AD Administrator Syncfusion Team May 12, 2005 09:41 PM UTC

Hi Kevin, The Diagram Controller has the SelectionChanging and SelectionChanged events that are fired when the node selection changes. Will the Controller.SelectionChanged event not work for what you are trying to accomplish in your application? Prakash Syncfusion Inc.,

AD Administrator Syncfusion Team May 13, 2005 02:07 AM UTC

Specifically speaking, it will not work, because the SelectionChanged event is fired for each node being added to the selection list. However, I take back my request, because my workaround is, and would, practically be the same as the SelectionChangedComplete. My problem was that if I select 10 nodes (via the mouse by clicking and dragging), each time one of those nodes is added to the selection list the SelectionChanged event is fired (thus fired 10 times). Essentially, I want to execute a method Foo one time, once all 10 nodes are selected. If you were to add OnSelectionChangedComplete, it would probably be called in SelectTool.cs under IMouseEventReceiver.MouseUp after the ''for each node hit add to list''. But that would be weird calling into the controller like that. Anyways, The method (my workaround) I am using is just listening for the MouseUp event, and then checking the selection list to see if anything is selected, then calling Foo. I am currently just implementing the architecture for the diagram side of our app, and I am tapping into the power you have provided. The diagram alone has saved me 1+ years of development. I''m using VS 2005 B2 and have not had any problems at all.

AD Administrator Syncfusion Team May 18, 2005 06:39 PM UTC

Hi Kevin, I had overlooked a drag selection scenario that involved multiple nodes being selected. The Diagram NodeCollection class has the option to add a range of nodes to the collection, and we have changed the SelectTool behavior to use the NodeCollection''s AddRange method in place of adding nodes individually. This will ensure that the SelectionChanging/SelectionChanged events are fired just once when multiple nodes are selected. The next update of Essential Diagram will ship with the revised code. Thank you bringing this issue to our attention. Regards, Prakash Surendra Syncfusion Inc.,

AD Administrator Syncfusion Team May 25, 2005 05:28 PM UTC

Great! Thanks for the response. I know it is insignificant, but the code update is appreciated.

Live Chat Icon For mobile
Up arrow icon