This is a migrated thread and some comments may be shown as answers.

Deleting multi-selection of RadDiagramItem fires events for each individual item

1 Answer 139 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Matthias
Top achievements
Rank 1
Matthias asked on 29 Jun 2017, 07:03 PM

When I select multiple shapes in my RadDiagram and execute the Delete command, I expect two events to fire: 

RadDiagram.ItemsChanging and RadDiagram.ItemsChanged.

In each event, I expect e.OldItems to contain all shapes that are being deleted.

Instead, I get individual event: first ItemsChanging and then ItemsChanged for every individual item in my selection. e.OldItems contains a single object every time.

Is this expected behavior? If not, what might I be doing wrong? Getting the shapes in individual events is bad because it doesn't allow me to prioritize the order in which I operate on each shapes. And because ItemsChanging and ItemsChanged fire for each shape until the next one happens, I can't easily cache all the changing items and THEN operate on the whole collection, either.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 04 Jul 2017, 01:55 PM
Hello Matthias,

This behavior is indeed expected as in order for each deletion to be undoable, the items have to be removed one by one. If you wish to modify this behavior, you can override the Delete command as suggested in this article and handle the process manually.

I hope you find this helpful.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Matthias
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or