Index: src/Deltares.DSoilModel.Forms/DSoilModelContext.cs =================================================================== diff -u -r609 -r630 --- src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 609) +++ src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 630) @@ -347,22 +347,46 @@ var grid = source as GridViewControl; if (grid != null) { - if ((member == "EditCommand" || member == "PasteCommand" || member == "CopyCommand") && (grid.Name == "CptsGridViewControl" || grid.Name == "BoringsGridViewControl")) + switch (member) { - return false; + case "AddRowCommand": + case "InsertRowCommand": + switch (grid.Name) + { + case "SoilSegmentsTable": + case "SurfaceLinePointsGridControl": + return false; + } + break; + case "DeleteRowCommand": + switch (grid.Name) + { + case "SurfaceLinePointsGridControl": + return false; + } + break; + case "CopyCommand": + switch (grid.Name) + { + case "CptsGridViewControl": + case "BoringsGridViewControl": + case "SurfaceLinePointsGridControl": + return false; + } + break; + case "PasteCommand": + case "EditCommand": + switch (grid.Name) + { + case "CptsGridViewControl": + case "BoringsGridViewControl": + case "SurfaceLinePointsGridControl": + case "CPTsTable": + case "BoringsTable": + return false; + } + break; } - - // GridViewControls from DSoilModelPlugin - if ((member == "EditCommand" || member == "PasteCommand") && (grid.Name == "CPTsTable" || grid.Name == "BoringsTable")) - { - return false; - } - - // GridViewControl from DSoilModelPlugin - if ((member == "AddRowCommand" || member == "InsertRowCommand") && grid.Name == "SoilSegmentsTable") - { - return false; - } } return base.IsEnabled(source, member); Index: src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs =================================================================== diff -u -r609 -r630 --- src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs (.../DSoilModelContextTest.cs) (revision 609) +++ src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs (.../DSoilModelContextTest.cs) (revision 630) @@ -457,6 +457,12 @@ [TestCase("CPTsTable", "PasteCommand", false)] [TestCase("SoilSegmentsTable", "AddRowCommand", false)] [TestCase("SoilSegmentsTable", "InsertRowCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "AddRowCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "InsertRowCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "DeleteRowCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "CopyCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "PasteCommand", false)] + [TestCase("SurfaceLinePointsGridControl", "EditCommand", false)] public void IsEnabledTest_GridViewControl(string gridViewControlName, string memberName, bool expectedEnabled) { var context = new DSoilModelContext();