Grid.PerformAction(UltraGridAction.Copy); is causing following exception.
i have 80,000 rows and 19 columns. i selected all rows and when i perform copy by above statement i get exception.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
at System.Text.StringBuilder.Append(String value)
at Infragistics.Win.UltraWinGrid.MultiCellOperationInfo.GetHtmlText(CellValuesCollection cellValues)
at Infragistics.Win.UltraWinGrid.MultiCellOperationInfo.GetClipboardDataObject(CellValuesCollection cellValues, Boolean fireBeforeMultiCellOperationEvent)
at Infragistics.Win.UltraWinGrid.MultiCellOperationInfo.PerformMultiCellOperation(MultiCellOperation operation)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.PerformMultiCellOperation(MultiCellOperation operation)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.PerformAction(UltraGridAction actionCode, Boolean shiftKeyDown, Boolean ctlKeyDown)
at Infragistics.Win.UltraWinGrid.UltraGrid.PerformAction(UltraGridAction actionCode, Boolean shift, Boolean control)
at Infragistics.Win.UltraWinGrid.UltraGrid.PerformAction(UltraGridAction actionCode)
Any help would be appreciated..
Thanks,
Kiran
Hi,
This sounds like it might be a bug. I forwarded this thread over to Infragistics Developer Support so they can check it out.
are there any properties i need to set or verify to prevent this error.
if i hide 9 columns then, i can copy 80,000 rows with 10 columns without any issue.
Before confirming that this it is Infragistics Bug do you want me to verify any grid property values on my end.
if i copy the entire data in chuncks to excel file then i can copy enitire data into memory.
I'm not sure how excel does that.
Hi Kiran,
I doubt there is anything you can do. It looks like the grid is trying to copy the entire contents of the grid to the clipboard using a StringBuilder and there is simply too much content at once at the machine doesn't have enough memory to hold it all.
The solution to something like that would be to have the grid break up the strings instead of doing it all at once. I suspect this is not possible, since the string has to be applied to the clipboard all at once. So this may just be a limitation we will have to live with. But we should look into it and see if there's anything we can do.