Browse Source

Merge remote-tracking branch 'origin/frank' into kenric

Kenric Nugteren 2 years ago
parent
commit
fccb4ec780
1 changed files with 9 additions and 0 deletions
  1. 9 0
      InABox.DynamicGrid/DynamicGrid.cs

+ 9 - 0
InABox.DynamicGrid/DynamicGrid.cs

@@ -2631,6 +2631,11 @@ namespace InABox.DynamicGrid
         {
         }
 
+        protected virtual bool CanCreateItems()
+        {
+            return true;
+        }
+
         private bool AddEditClick(CoreRow[]? rows)
         {
             if (!IsEnabled || bRefreshing)
@@ -2638,6 +2643,10 @@ namespace InABox.DynamicGrid
 
             if (rows == null || !rows.Any())
             {
+                
+                if (!CanCreateItems())
+                    return false;
+                
                 var item = CreateItem();
 
                 // Yea, and this won't work, because we're actually usually showing the description of a linked item,