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.
Unfortunately, activation email could not send to your email. Please try again.

Undo/ Redo functionality in TreeViewAdv using HistoryManager property

 

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/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/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

Article ID: Published Date: Last Revised Date: Platform: Control:
1403 04/30/2011 07/10/2014 Windows Forms TreeViewAdv
Tags:
Did you find this information helpful?
Comments
EJohn Feb 02, 2018

Dear SIR,


Where to find HistoryManager ?


Thanks and regards,

E-John

Reply
Add Comment
You must log in to leave a comment

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.