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

Strange behaviour of SelectedNodesChanged event

10 Answers 124 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 24 Jan 2019, 09:56 AM

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

10 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Jan 2019, 01:24 PM
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.
0
Thomas
Top achievements
Rank 1
answered on 25 Jan 2019, 08:04 AM

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.

0
Alfred
Top achievements
Rank 1
answered on 26 Jan 2019, 11:42 AM
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.
0
Alfred
Top achievements
Rank 1
answered on 26 Jan 2019, 11:42 AM
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.
0
Alfred
Top achievements
Rank 1
answered on 28 Jan 2019, 06:53 AM
Any Suggestion? myprepaidcenter login
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Jan 2019, 12:51 PM
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.
0
Andrew
Top achievements
Rank 1
answered on 27 Feb 2019, 08:45 AM

definitely helpful suggestions

Andrew Piana

0
James
Top achievements
Rank 1
answered on 03 Sep 2019, 10:34 AM
Can anybody provide me with some helpful suggestions? myprepaidcenter login
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Sep 2019, 11:36 AM

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.
0
Arnold
Top achievements
Rank 1
answered on 24 Dec 2020, 11:58 AM
If anybody have proper solution for this topic. i am thanks to in advance. https://prepaidgiftbalance.club/
Tags
Treeview
Asked by
Thomas
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Thomas
Top achievements
Rank 1
Alfred
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
James
Top achievements
Rank 1
Arnold
Top achievements
Rank 1
Share this question
or