Dear all,
I met two problems.
1. "Undo" only worked when the XML file was loaded. However, it didn't
work when the new row is added in the dataTable ["a"] in dvg.
There are dgv, dataset and target xml file in my application.
Therefore, I wrote the codes as follows in the "Undo" button handler
function.
if (dgv.IsCurrentCellInEditMode)
{
// Nothing. If cell was in the EditMode, then cellMenuStrip will
show up when user right clicks on the cell.
}
else
{
DataTable _dt = dataSet.Tables["a"];
_dt.RejectChanges();
}
The problem is happening at the point _dt.RejectChanges(), due to the
reason that it can't be evaluated. (I don't know why.) The principle
in my "add row in table" is, e.g. new row is added in the dgv, then
update the bounded dataSet afterwards. The table["a"] in dataSet
worked correctly.
2. Is it possible for me to add the "redo" function in the
CellContextMenuStrip?
3. How shall I implement the "redo" in the dgv?
Thanks in advance,
Rush Hour.