How to detect which item user is tapped on the treeview

Hi SyncFusion,

In the code of using SfTreeView package, I added the TreeViewSelectedItem method to detect which option the user selects
But this method seems to only work when SelectedItemChanged...




If I click "Downloads" first, ItemSelected function is triggered and the message of SelectedItem.ItemName is displayed
Then I click "Downloads" again, the message window will no longer pop up...


To confirm that clicking "Downloads" for the second time is no action, I set a breakpoint in the line code "if (treeViewSelectedItem != value)", and it did not been executed.




I want to ask if I want to detect every time the user clicks on the item but not just SelectedItemChanged
How should I modify my code?








Attachment: NaviTreeview20210318_aa3dd514.zip

1 Reply 1 reply marked as answer

SS SaiGanesh Sakthivel Syncfusion Team March 18, 2021 09:13 AM UTC

Hi HannahC,

Thank you for using syncfusion support.

#Regarding How to detect which item user is tapped on the treeview
We would like to inform you that you can achieve your requirement with the help of Item Tapped event or Tap Command in SfTreeview. Please refer to the following UG link for your reference. 
 

please let us know if you have any concern.

Regards,
SaiGanesh Sakthivel



Marked as answer
Loader.
Up arrow icon