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
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
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.
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
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