I'd like to be able to copy highlighted rows in wingrid and paste them into the same grid as new rows. I've seen other forum topics on this, but they're all very old and from what I can see they don't always work. What's the current suggested method for doing this?
Hello Sean,
Thank you for posting. The grid supports copy and pastes within a cell by default. Since you want to copy and paste rows or ranges of cells, then you need to set the AllowMultiCellOperation property.
Something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { this.ultraGrid1.DisplayLayout.Override.AllowMultiCellOperations = Infragistics.Win.UltraWinGrid.AllowMultiCellOperation.All; }
Attached a sample application for the reference. Let me know if you have any question.
Regards,Divya
CopyPasteUltraGrid.zip
Thanks, that mostly worked. I've got a couple issues though that I'd like to run by you.
1. When I select 2 rows to copy it tells me that I can't insert a NULL into one of the cols, but that col isn't NULL for either of the 2 rows.
2. I've got an ID col in the row and when I paste it into the new row it fires a message that the ID can't be edited and do I want to continue pasting the rest of the cols... is there a way to suppress that message?