*Experts* DiverDan Posted February 4, 2003 *Experts* Posted February 4, 2003 Once a row or multipule rows are removed from the listview how can they be reinststed with undo? Here's what I have so far... Case "Clear &Row" Try btnUndo.ImageIndex = 19 Dim i As ListViewItem Dim myDataObject As New DataObject() For Each i In lvwData.SelectedItems myDataObject.SetData(DataFormats.Text, True, lvwData.SelectedItems) Clipboard.SetDataObject(myDataObject, True) lvwData.Items.Remove(lvwData.SelectedItems(0)) Next Catch End Try Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
*Gurus* divil Posted February 4, 2003 *Gurus* Posted February 4, 2003 You could try adding the ListViewItems themselves in to an undo stack (use the System.Collections.Stack class) when you remove them. When you undo, simply pop the item back off the stack and re-add it to the list. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* DiverDan Posted February 5, 2003 Author *Experts* Posted February 5, 2003 Thanks divil....I'll give it a try Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.