Rectangle selection on Visualization Layer

4 posts, 0 answers
  1. Pavel
    Pavel avatar
    5 posts
    Member since:
    Aug 2019

    Posted 25 Oct Link to this post

    Hello. When i using rectangle selection via lshift key and select the objects, and i already have selected objects, layer unselect previous objects. How i can add objects in to selected objects collection via rectangle selection?
  2. Dinko
    Admin
    Dinko avatar
    951 posts

    Posted 30 Oct Link to this post

    Hello Pavel,

    Your scenario sounds like multiple selection mode. The selection functionality of the VisualizationLayer mimics the extended selection mode. In a few words using rectangle selection will select only the items inside the rectangle and unselect the ones out of it.

    What comes up to my mind is to use custom code to achieve this. I will use the VisualizationLayerItemsSelection SDK example, for example. Inside the LayerSelectionChanged event handler, I am removing the logic for setting the IsSelected property to false. This way creating the rectangle will select all items inside and don't unselect the others. A question here arises, how to unselect an item then. You could do this using an attached property. You can subscribe to the MouseDown event of the MapPinPoint.

    For your convenience, I have modified the SDK example to demonstrate this. You can additionally extend this approach, so it covers all your cases.

    Regards,
    Dinko
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Pavel
    Pavel avatar
    5 posts
    Member since:
    Aug 2019

    Posted 30 Oct Link to this post

    Thanks for the answer, but i'm using the PathData class (MapShapeData) for items, and IsSelected is have only get option.
  4. Dinko
    Admin
    Dinko avatar
    951 posts

    Posted 04 Nov Link to this post

    Hello Pavel,

    You are right the IsSelected property has only a getter. I have searched for a possible solution but wasn't able to find a suitable one to fit in your case. I am afraid I can suggest a workaround for this particular case when using Map Shape Data objects.

    Regards,
    Dinko
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top