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.

Undo/Redo in Virtual Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

7045 Sep 10,2003 11:13 AM Sep 10,2003 12:37 PM Windows Forms 3
loading
Tags: GridControl
Jason Thompson
Asked On September 10, 2003 11:13 AM

I am attempting to get undo/redo to work with a virtual grid. Is this possible? I keep seeing a duo of caught exceptions in the debug output when I attempt to Undo an action: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: rowIndex at Syncfusion.Collections.SFTable.set_Item(Int32 rowIndex, Int32 colIndex, Object value) at Syncfusion.Windows.Forms.Grid.GridRowCollection.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value) at Syncfusion.Windows.Forms.Grid.GridData.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value) at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: rowIndex at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType) at Syncfusion.Windows.Forms.Grid.GridModel.ChangeCells(GridRangeInfo range, GridStyleInfo[] cellsInfo, StyleModifyType modifyType) at Syncfusion.Windows.Forms.Grid.GridChangeCellsCommand.Execute() at Syncfusion.Windows.Forms.Grid.GridModelCommandManager.Execute(GridCommandMode mode) catched at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridModelCommandManager.Execute(GridCommandMode mode) in :line 0 I am using the CommandStack at gridControl1.CommandStack. Is there a difference between using gridControl1.CommandStack and gridControl1.Model.CommandStack? Jason

Jason Thompson
Replied On September 10, 2003 11:17 AM

I forgot to mention that the Undo I am attempting is the edit of a value in a cell. Undos for row resizing, column resizing, etc. seem to work fine. Jason

Administrator [Syncfusion]
Replied On September 10, 2003 11:29 AM

So, you are in the middle of typing into several cells, an dyou start pressing ctl+Z to undo things. Is this what you are doing? This seems to work OK in the VirtGridTutorial sample if I add this.gridControl1.CommandStack.Enabled = true; to turn on the undo in that sample. I suspect the problem is something to do with trying to place non numbers into numeric cells. Try setting DevStu to stop when you encounter an exception. This should stop you right at the problem, allowing you to look at the call stack to try to see what is going on.

Jason Thompson
Replied On September 10, 2003 12:37 PM

Actually, the problem occurred because the GridSaveCellInfoEventArgs e did not have a valid Style.CellIdentity member when the SaveCellInfo event was triggered by the Undo. Since I was assuming it to be valid, we all know what I made of myself :) Thanks for the help! Jason

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.

;