Strange behaviour of SelectedNodesChanged event

10 posts, 1 answers
  1. Thomas
    Thomas avatar
    29 posts
    Member since:
    Oct 2012

    Posted 24 Jan Link to this post

    Hello, 
    We're using RadTreeView with a mutiselection and expect that SelectedNodesChanged event will be fired once user select/deselect set of nodes (e.g. with Shit Key), Unfortunately it fires much more times.
    Example: if I have several nodes selected and just click on any single node, I expect SelectedNodesChanged event will be fired only once, or at least two times (collection cleared, and then filled with single node), but it fires as much as I have selected nodes plus one? are you ok with that?

    Could you explain how it works? for me it looks like a bug. It's replicated on latest 2019 R1 release

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3421 posts

    Posted 24 Jan Link to this post

    Hello, Thomas,      

    The selection process in RadTreeView includes unselecting the previously selected nodes first and then making selection for the new nodes. This means that the SelectedNodesChanged event will be fired once for each selection process for the respective node. Consider that we have a RadTreeView will no selected nodes. Then, click Node2. It gets selected and the SelectedNodesChanged event will be fired once for Node2 (selected). Then, if you click Node4 while pressing the Shift key, this will clear the previously available selection and select the new nodes. The SelectedNodesChanged event fill be fired once for each node that is previously selected, Node2 in this case. Then, it will perform the multiple selection while keeping pressed the Shift key. Thus, the SelectedNodesChanged event will be fired three times, once for Node2 (selected), once for Node3 (selected) and once for Node4 (selected). The attached gif file illustrates better the behavior.

    If the selection behavior in RadTreeView doesn't suit your scenario or somehow it breaks the correct execution of your application, it would be greatly appreciated if you can give us some more details about the exact requirement that you are trying to achieve and how does the selection process affect it. Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance.

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

     Regards,
    Dess | Tech Support Engineer, Sr.
    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. Thomas
    Thomas avatar
    29 posts
    Member since:
    Oct 2012

    Posted 25 Jan in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you for explanation. Just expected that event SelectedNodeChanged have to be fired many times for each deselected node, and then only once SelectedNodesChanged for the whole collection.

  4. Alfred
    Alfred avatar
    4 posts
    Member since:
    Jan 2019

    Posted 26 Jan Link to this post

    The SelectedNodeChanged event is raised when a node is selected in the TreeView control. This allows you to provide an event-handling method that performs a custom routine, such as updating the displayed content, whenever this event occurs.
  5. Alfred
    Alfred avatar
    4 posts
    Member since:
    Jan 2019

    Posted 26 Jan Link to this post

    The SelectedNodeChanged event is raised when a node is selected in the TreeView control. This allows you to provide an event-handling method that performs a custom routine, such as updating the displayed content, whenever this event occurs.
  6. Alfred
    Alfred avatar
    4 posts
    Member since:
    Jan 2019

    Posted 28 Jan in reply to Alfred Link to this post

    Any Suggestion? myprepaidcenter login
  7. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3421 posts

    Posted 28 Jan Link to this post

    Hello, Alfred,      

    Indeed, the SelectedNodeChanged event is suitable for executing some custom logic according to the selection. As it was already explained in my previous reply, you can perform the custom logic only when the node in the event's arguments is selected. Thus, you can restrict the custom execution.

    I hope this information helps. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    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.
  8. Andrew
    Andrew avatar
    2 posts
    Member since:
    Feb 2019

    Posted 27 Feb Link to this post

    definitely helpful suggestions

    Andrew Piana

  9. James
    James avatar
    1 posts
    Member since:
    Sep 2019

    Posted 03 Sep Link to this post

    Can anybody provide me with some helpful suggestions? myprepaidcenter login
  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3421 posts

    Posted 03 Sep Link to this post

    Hello, James,  

    According to the provided brief information, it is not clear enough what is the exact question that you have regarding the Telerik UI for WinForms suite. Could you please specify in details what is the precise requirement that you are trying to accomplish? Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance.

    I am looking forward to your reply. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    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