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

Modifying SelectedItems

2 Answers 119 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Thomas Dahl Pedersen
Top achievements
Rank 1
Thomas Dahl Pedersen asked on 09 Jul 2014, 12:40 PM
Hi.

I'd like to be able to disallow the user from selecting connections between the nodes.

I.e.: The user selects a group of nodes on the canvas by dragging the selection rectangle to include the desired nodes. By default, the connections in the rectangle are selected too: They are included in the SelectedItems (IEnumerable) at the time the SelectionChanged event is fired.
Is it in any way possible remove the links between the nodes from the selected items.



2 Answers, 1 is accepted

Sort by
0
Thomas Dahl Pedersen
Top achievements
Rank 1
answered on 09 Jul 2014, 02:31 PM
Okay, I have now discovered the SelectionService, which I can get a reference to using the ServiceLocator on the diagram.
If I iterate over the SelectedItems property of the selectionservice I can set the IsSelected property to false for the items that I don't want selected. So far so good.

Is that the recommended way to do what I want?
0
Pavel R. Pavlov
Telerik team
answered on 14 Jul 2014, 06:11 AM
Hello Thomas,

We encourage our customers to use and extend the services exposed by the RadDiagram. This is why your approach is correct and recommended. 

Also, you can consider checking (or clearing) the SelectedConnections property.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Diagram
Asked by
Thomas Dahl Pedersen
Top achievements
Rank 1
Answers by
Thomas Dahl Pedersen
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or