We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Subscribing to AfterItemEdit if tree items are dynamic

Thread ID:

Created:

Updated:

Platform:

Replies:

146685 Aug 14,2019 05:06 AM UTC Aug 19,2019 08:41 AM UTC WPF 3
loading
Tags: TreeViewAdv
Hayley Miller
Asked On August 14, 2019 05:06 AM UTC

Hello,

How would I go about subscribing to the AfterItemEdit event for each item in the TreeViewAdv if I am using data binding and the tree view items are dynamic?

Thanks,

Hayley


Dinesh Babu Yadav [Syncfusion]
Replied On August 15, 2019 08:44 AM UTC

Hi Havley 
 
Thank you for contacting Syncfusion Support 
 
Query :How would I go about subscribing to the AfterItemEdit event for each item in the TreeViewAdv if I am using data binding and the tree view items are dynamic? 
 
We have checked your query and observed that you need to access the AfterItemEdit event for TreeViewItemAdv using databinding. We have prepared the simple sample for the same and subscribed the AfterItemEdit event of TreeViewItem using ItemContainerStyle property of TreeViewAdv.  It would invoke for all the items and dynamic added treeviewitems. Please find the sample and code from below: 
 
Code[XAML] 
 
<syncfusion:TreeViewAdv x:Name="TreeViewone"  ItemsSource="{Binding TreeItems}" SelectedTreeItem="{Binding SelectedTreeItem, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="0"> 
 
<syncfusion:TreeViewAdv.ItemContainerStyle> 
<Style TargetType="{x:Type syncfusion:TreeViewItemAdv}"> 
<EventSetter Event="AfterItemEdit" Handler="TreeViewItemAdv_AfterItemEdit"/> 
</Style> 
</syncfusion:TreeViewAdv.ItemContainerStyle> 
<syncfusion:TreeViewAdv.ItemTemplate> 
 
<HierarchicalDataTemplate ItemsSource="{Binding SubItems}"> 
 
<TextBlock Text="{Binding Header}" /> 
 
</HierarchicalDataTemplate> 
 
</syncfusion:TreeViewAdv.ItemTemplate> 
 
</syncfusion:TreeViewAdv> 
 
 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards 
Dinesh Babu Yadav 


Hayley Miller
Replied On August 16, 2019 01:09 AM UTC

Thanks! This works great :)


Subburaj Pandian Veluchamy [Syncfusion]
Replied On August 19, 2019 08:41 AM UTC

Hi Hayley, 
 
Thank you for the update. We are glad that the given solution meets your requirement. 

Please get in touch with us, if you would require any further assistance in future.  
 
Regards,
Subburaj Pandian V  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon