Hello,
I am trying to copy/paste in UltraGrid (just usual Windows Ctrl-C/Ctrl-V) but it doesnt look straightforward.
I have used the below property to allow copy/paste. Still yet, its complaining the contents is more than current capacity.
Any workaround to resolve this, as we have requirement to enter huge values in the grid and this will be typically copied from the excel spreadsheet.
this.ultraGrid1.DisplayLayout.Override.AllowMultiCellOperations = AllowMultiCellOperation.Copy | AllowMultiCellOperation.Paste;
What's the problem, exactly? What is the error message you are getting? Where are you copying from and what is selected in the grid when you are pasting?
Right,
The problem is that, when I have ultragrid - single column with date values and need to have functionality for the user to copy list of dates from excel spreadsheet to this column. I can able to paste just one row but if the copy content is more than 1 row, then I see an error:
Error performing paste operation. Contents being paste have more rows than whats available starting from the anchor cell. Paste contents have 8 rows where as the available rows starting from the anchor cell are 1.
Can you suggest any solution ?
Hi,
So you are trying to add multiple rows into the grid in a single paste operation? That kind of operation is not currently supported.
You might be able to work around this by handling the BeforeMultiCellOperation event and adding the necessary number of extra rows to the grid or it's data source, but I'm no sure if this is possible.
I tried handling BeforeMultiCellOperation event, but it appears the number of cells that were copied from Excel spreadsheet is not passed through this event handler, as I couldn't get exactly how many number of rows to add from e.Cells.RowsCount.
Can you suggest, how exactly BeforeMultiCellOperation can be handled in this case?
If this is not possible through UltraGrid, is there anyother workaround using other controls?
Thanks I got it working.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
You will have this ability just by doing what Mike said:
If you want to copy and paste from Excel into the WinGrid, you just have to turn on AllowMultiCellOperation on the Override to allow pasting.
Do you have the example in code so I can see how you did it?
Thanks.
Yes, you can. I did it the other way just for the video sample.