Modifying SelectedItems

3 posts, 0 answers
  1. Thomas Dahl Pedersen
    Thomas Dahl Pedersen avatar
    3 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2014 Link to this post

    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. Thomas Dahl Pedersen
    Thomas Dahl Pedersen avatar
    3 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2014 in reply to Thomas Dahl Pedersen Link to this post

    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?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 14 Jul 2014 Link to this post

    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.
     
Back to Top