Subscribing to model changes

I am looking at the Context Menu example for TreeViewAdv. I would like to subscribe to changes in the treeview model.  For example, If I rename a node, how can I take action when the node is renamed?

Thanks

3 Replies

KJ Keerthana Jegannathan Syncfusion Team December 12, 2017 11:00 AM UTC

Hi Michael, 
 
Thank you for contacting Syncfusion support. 
 
We understand that you have below requirements in TreeViewAdv 
 
1)Need to display Context Menu to the items of the TreeViewAdv. 
2)Need an event to perform some action when header of the TreeViewItemAdv is edited. 
 
If so, we have prepared a simple sample with TreeViewAdv in which we have displayed Context Menu using the “Context Menu” property of the TreeViewItemAdv and there is an event named “AfterItemEdit” which has been called when item is edited. It can be downloaded from the below location. 
 
 
Also, please refer the below documentation link for further reference. 
 
 
Regards, 
Keerthana J 
 
 



MR Michael Rensing December 12, 2017 02:56 PM UTC

Thanks for the example. I am using a Style to style the TreeViewItemAdv. Using a Setter Property, AfterItemEdit is not recognized.  How would I enable this using Style?


KJ Keerthana Jegannathan Syncfusion Team December 13, 2017 04:21 AM UTC

Hi Michael, 
 
Thanks for your update. 
 
In TreeViewItemAdv, “AfterItemEdit” is an event which is used to detect the renaming the header of it. While using style to TreeViewItemAdv, you need to use “EventSetter” instead of “Setter” in style in order to handle the event. We have prepared a sample in which we have handled the “AfterItemEdit” event using “EventSetter” and it can be downloaded from below location. 
 
 
Regards, 
Keerthana J 


Loader.
Up arrow icon