Exception when copying and pasting . .

I get an error on the grid if i try to copy and paste using Control-C and Control-V into cell where the paste extends past the last column.

for example, if i have 1 row and 3 columns, and i copy the first 2 cells and move the selected cell all the way over to the right and hit Control-V, i get this exception below.

Please advise.

thks,
ak

Index was outside the bounds of the array
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Syncfusion.Windows.Forms.Grid.GridModel.OnSaveCellInfo(GridSaveCellInfoEventArgs e)
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.GridModelStyleDataExchange.PasteCellsFromDataObject(GridData data, GridRangeInfo range, Boolean bIgnoreDiffRange, Int32 dragDropFlags)
at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.OnPasteFromClipboard(GridRangeInfo rg)
at Syncfusion.Windows.Forms.Grid.GridModelCutPaste.Paste()
at Syncfusion.Windows.Forms.Grid.GridControlBase.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at Syncfusion.Windows.Forms.Grid.GridControlBase.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Syncfusion.Grid.Windows


1 Reply

JS Jeba S Syncfusion Team April 25, 2007 08:51 AM UTC

Hi Adam,

Please refer the knowledge base articles to avoid the exception.

How to stop the errors thrown when pasting larger clipboard contents in a GridDataBoundGrid?


How do I paste clipboard contents bigger than GridDataBoundGrid row and column count?


Also refer this forum thread for more details:
http://www.syncfusion.com/support/Forums/message.aspx?MessageID=28066

Kindly let us know if this helps.

Best Regards,
Jeba.



Loader.
Up arrow icon