Index: src/Deltares.DSoilModel.Forms/DSoilModelContext.cs =================================================================== diff -u -r773 -r798 --- src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 773) +++ src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 798) @@ -22,6 +22,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using Deltares.DSoilModel.Data; using Deltares.Geotechnics; using Deltares.Geotechnics.ConePenetrationTest; @@ -410,15 +411,15 @@ } break; case "CopyCommand": - switch (grid.Name) + // Copy is always allowed. But see if there is at least one cell selected first, no use when nothing is selected. + if (grid.gridView1 != null) { - case "CptsGridViewControl": - case "BoringsGridViewControl": - case "SurfaceLinePointsGridControl": - return false; + return grid.gridView1.GetSelectedCells().Any(); } - break; + return true; case "PasteCommand": + // As Paste does not work correctly in all cases (checkboxes, enums) disable it for now. + return false; case "EditCommand": switch (grid.Name) { @@ -428,8 +429,8 @@ case "CPTsTable": case "BoringsTable": return false; + default: return true; } - break; } }