[mapguide-commits] r8403 - trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Oct 15 07:09:41 PDT 2014


Author: jng
Date: 2014-10-15 07:09:41 -0700 (Wed, 15 Oct 2014)
New Revision: 8403

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs
Log:
#2469: Don't enable the delete button if there's only one rule left.

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs	2014-10-14 13:08:53 UTC (rev 8402)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleGridView.cs	2014-10-15 14:09:41 UTC (rev 8403)
@@ -789,6 +789,10 @@
 
         private void btnDeleteRule_Click(object sender, EventArgs e)
         {
+            //Minimum content model dictates that we must have at least one rule
+            if (grdRules.Rows.Count == 1)
+                return;
+
             List<RuleModel> remove = new List<RuleModel>();
             foreach (DataGridViewRow row in grdRules.SelectedRows)
                 remove.Add((RuleModel)row.DataBoundItem);
@@ -820,7 +824,15 @@
 
         private void grdRules_SelectionChanged(object sender, EventArgs e)
         {
-            btnDeleteRule.Enabled = (grdRules.SelectedRows.Count > 0);
+            if (grdRules.Rows.Count <= 1)
+            {
+                //Minimum content model rules dictate that we must have at least one rule
+                btnDeleteRule.Enabled = false;
+            }
+            else
+            {
+                btnDeleteRule.Enabled = (grdRules.SelectedRows.Count > 0);
+            }
             if (grdRules.SelectedRows.Count == 1)
             {
                 btnUp.Enabled = grdRules.SelectedRows[0].Index > 0;



More information about the mapguide-commits mailing list