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.
Syncfusion Feedback

Grid Undo command.stack virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

103432 May 2,2012 10:47 PM UTC May 9,2012 06:12 PM UTC Windows Forms 1
loading
Tags: GridControl
Smitha
Asked On May 2, 2012 10:47 PM UTC

Hi,

My gridcontrol for windows forms is not doing the undo functionality.

void GridSaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
theGrid.CommandStack.Enabled = true;
if (e.ColIndex > 0 && e.RowIndex > 0)
{
//do something
if (e.ColIndex % 2 == 1)
{
// Convert a CellValue to the desired type using Syncfusion 'Convert' class.
DateTime dttm = (DateTime)GridCellValueConvert.ChangeType(e.Style.CellValue, typeof(DateTime), null);

// Debug.Assert(dttm == (DateTime)e.Style.CellValue);
//do something
}
else
{
// Convert a CellValue to the desired type using Syncfusion 'Convert' class.
float value = (float)GridCellValueConvert.ChangeType(e.Style.CellValue, typeof(float), null);
// Debug.Assert(value == (float)e.Style.CellValue);
//do something
}
}
e.Handled = true;
}

private void UndoCellsToolStripMenuItem_Click(object sender, EventArgs e)
{

if (!this.theGrid.CommandStack.InTransaction)
{
this.theGrid.CommandStack.Undo();
ShowStacks();
}
}

Where should i enable commandstack= true?
My grid's data is first in a middle layer(data array) and then relects in the grid.
So Any changes i make to the grid are reflceted in the data array.

Thank you
SC



Asarudheen S [Syncfusion]
Replied On May 9, 2012 06:12 PM UTC

Hi Smitha,

 

Thank you for your interest in Syncfusion products,

 

The undo operation and the redo operation can be achieved from the CommandStack object of the GridControl, which is retrieved from the table control base.

 

Please refer the UG documentation from the below location:’

 

http://help.syncfusion.com/ug_84/User%20Interface/Windows%20Forms/Grid/default.htm?turl=Documents%2Fmultilevelundoandredo.htm

 

 

Also refer the forum from the below link which show case the implementation of the behavior in virtual grid:

 

http://www.syncfusion.com/support/forums/grid-windows/17487

 

 

Let me know if you have any queries.

 

Regards,

Asarudheen.


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.

Warning Icon 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.Close Icon

;