How to retrieve information of custom nodes by clicking on them

Hello Syncfusion Staff

I inherited the NodeViewModel class to create custom nodes, and now I am trying to get some information from them by clicking on them. However, most of the information, including the one belonging to the base (NodeViewModel), is not accessible. So, I am not sure of what I should do with the argument of the events, such as ItemTappedEvent, MenuItemClickedEvent, and so forth, to be able to get those properties and methods. If you could provide an example (that uses C#) that shows how to achieve that goal, I would be extremely grateful.

Thank you,

Mohammad

 

1 Reply 1 reply marked as answer

KR Karkuvel Rajan Shanmugavel Syncfusion Team March 31, 2021 10:07 AM UTC

Hi Mohammad, 
 
Thanks for contacting Syncfusion support. 
 
Requirement: How to access the base class(NodeViewModel) properties of a CustomNode in ItemTappedEvent. 
 
We can easily access all the public properties of a NodeViewModel in ItemTappedEvent through its ItemTappedEventArgs. We have prepared a simple sample with custom NodeViewModel with a public property and in ItemTappedEvent, we have used the Item property of the Argument to get the tapped item. From the item we can get all the public properties of the Custom NodeViewModel and the public properties of its base class(NodeViewModel). Please find the sample below. 
 
 
Regards, 
Karkuvel Rajan S 


Marked as answer
Loader.
Up arrow icon