)
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

How to perform undo or redo functionality in WinForms TreeViewAdv using HistoryManager property?

Platform: WinForms |
Control: TreeViewAdv |
Published Date: April 30, 2011 |
Last Revised Date: February 5, 2020

Undo and Redo

The user should get the HistoryManager to use and then the HistoryEnabled property should be set to true. The HistoryManager plays the role in the Undo or Redo actions.

The Undo and Redo functionality of a TreeViewAdv does the following actions:

1. Deleting a node

2. Adding a node

3. Editing node's Text

4. Drag and drop of a node

C#

private void barItem1_Click(object sender, System.EventArgs e)
{
   if(this.treeViewAdv1.HistoryManager.CanUndo==true)
   {
       this.treeViewAdv1.HistoryManager.Undo();
   }
}
private void barItem2_Click(object sender, System.EventArgs e)
{
   if(this.treeViewAdv1.HistoryManager.CanRedo==true)
   {
       this.treeViewAdv1.HistoryManager.Redo();
   }
}

VB

Private Sub barItem1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
   If Me.treeViewAdv1.HistoryManager.CanUndo=True Then
       Me.treeViewAdv1.HistoryManager.Undo()
   End If
End Sub
Private Sub barItem2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
   If Me.treeViewAdv1.HistoryManager.CanRedo=True Then
       Me.treeViewAdv1.HistoryManager.Redo()
   End If
End Sub

Reference link: https://help.syncfusion.com/windowsforms/treeview/history-manager

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
EJohn
Feb 02, 2018

Dear SIR,


Where to find HistoryManager ?


Thanks and regards,

E-John

Reply

Please sign in to access our KB

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

Up arrow icon

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