property Grid.UndoListAction ([Action as Variant], [Count as Variant]) as String
Lists the Undo actions that can be performed in the control.

TypeDescription
Action as Variant [optional] A long expression that specifies the action being listed. If missing or -1, all actions are listed. 

The Action parameter can be one of the following:

  • exListUndoRedoAddItem(13) ~ "AddItem;ITEMINDEX", indicates that a new item has been created
  • exListUndoRedoRemoveItem(14) ~ "RemoveItem;ITEMINDEX", indicates that an item has been removed
  • exListUndoRedoChangeItemPos(15) ~ "ChangeItemPos;ITEMINDEX", indicates that an item changes its position or / and parent
  • exListUndoRedoChangeCellValue(16) ~ "ChangeCellValue;ITEMINDEX;CELLINDEX", indicates that the cell's value has been changed
  • exListUndoRedoChangeCellState(17) ~ "ChangeCellState;ITEMINDEX;CELLINDEX", indicates that the cell's state has been changed

For instance, UndoListAction(13) shows only AddItem actions in the undo stack.

Count as Variant [optional] A long expression that indicates the number of actions being listed. If missing or -1, all actions are listed. For instance, UndoListAction(13,1) shows only the last AddItem action being added to the undo stack
String A String expression that lists the Undo actions that may be performed.
Use the UndoListAction property to show the list of actions that the user may perform by doing Undo operations. The URChange(exUndo/exRedo) event notifies your application whenever an Undo/Redo operation is performed. For instance, the URChange(exUndoRedoUpdate) notifies whether a new operation is added/removed from the undo/redo queue.  Use the UndoRemoveAction method to remove the last actions from the undo queue. The RedoListAction property lists the Redo actions that can be performed in the control. The CanUndo property specifies whether an undo operation can be performed if CTRL+Z key is pressed.

The records of the Undo/Redo queue may contain actions in the following format:

Also, the Undo/Redo queue may include:

Each action is on a single line, and each field is separated by ; character.  The lines are separated by "\r\n" characters ( vbCrLf in VB ). 

The following VB sample splits the UndoListAction value and adds each action to a listbox control:

List1.Clear
Dim s() As String
s = Split(Grid1.UndoListAction, vbCrLf)
For i = LBound(s) To UBound(s)
            List1.AddItem s(i)
Next