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.

Grid Undo

Thread ID:

Created:

Updated:

Platform:

Replies:

103336 Apr 23,2012 05:36 PM May 4,2012 06:54 AM Windows Forms 5
loading
Tags: GridControl
Smitha
Asked On April 23, 2012 05:36 PM

Hi Mercy,

Could you please post a working version of grid undo functionality.
The commandstack.undo = true works in some cases
Thank yu
SC


Jeya Preetha M [Syncfusion]
Replied On April 24, 2012 07:16 AM

Hi Smitha,

Thanks for your interest in Syncfusion products.

Grid undo functionality is working in the current version 10.1.

Please let me know if you have any concerns.

Regards,
Jeya Preetha M


Smitha
Replied On April 24, 2012 12:40 PM

Hi,

Do u have any working sample for the undo functionality

Sc


Mercy C [Syncfusion]
Replied On April 25, 2012 08:49 AM

Hi Smitha,

Thanks for your update.

You can enable undo operation by setting "CommandStack.Enabled" property to "true".

this.gridControl1.CommandStack.Enabled = true;

please refer to the sample in the following link
http://www.syncfusion.com/downloads/Support/DirectTrac/93616/Undo-Redo841806248.zip

Please let me know if you have any concerns.

Regards,
Mercy.C



Smitha
Replied On April 27, 2012 01:41 PM

Hi Mercy,
I am unable to reproduce your undo functionality inmy grid
Here's my code

private void frm1(object sender, EventArgs e)
{

this.theGrid.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Any;
this.theGrid.SelectCellsMouseButtonsMask = MouseButtons.Left;
contextMenu1.MenuItems.Add("Undo", new EventHandler(UndoCellsToolStripMenuItem_Click));
theGrid.Model.Options.ExcelLikeCurrentCell = true;
theGrid.Model.Options.ExcelLikeSelectionFrame = true;
theGrid.CommandStack.Enabled = true;
}
private void UndoCellsToolStripMenuItem_Click(object sender, EventArgs e)
{

if (!theGrid.CommandStack.InTransaction)
{

theGrid.CommandStack.Undo();
ShowStacks();
}
}
private void ShowStacks()
{
ShowRedoStack();
ShowUndoStack();
}

private void ShowUndoStack()
{
if (theGrid.CommandStack.UndoStack.Count != 0 && !(theGrid.CommandStack.UndoStack.Peek() is GridChangeCellsCommand))
{
theGrid.CommandStack.UndoStack.Pop();
}

if (theGrid.CommandStack.UndoStack.Count > 5)
{
theGrid.CommandStack.UndoStack.Clear();
}

}

Thank you
Smitha


Ragamathulla B [Syncfusion]
Replied On May 4, 2012 06:54 AM

Hi Smitha,

Thanks for your update.

Am afraid that am unable to reproduce your reported issue in our side and also we have the sample regarding your query please refer to the following path in our dashboard.

{InstalledPath}\Syncfusion\EssentialStudio\{Version}\Windows\Grid.Windows\Samples\2.0\MS Excel-Style Features\Undo-Redo Demo\

Let me know if you have any further concerns.

Regards,
Ragamathullah B.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;