From 2a8c7b4e3ebe5691fbbe84d8cf285be3f72b7c30 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期一, 09 十二月 2024 13:38:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |   44 +++++++++++++++++++++-----------------------
 1 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index e88ab78..a7fb76b 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -1362,6 +1362,8 @@
         /// <param name="icoName">鍥炬爣璺緞</param>
         public static void SetGridSear(GridView gridView1, PictureBox btnChkIco = null, Form fm = null, string fileName = "checkStatus", string icoName = "")
         {
+         //   gridView1.OptionsView.ColumnAutoWidth = false;鑷姩璋冩暣鍒楀
+
             foreach (GridColumn column in gridView1.Columns)
             {
                 column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
@@ -1430,6 +1432,24 @@
                     e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
+            gridView1.ValidatingEditor += (sender, e) =>
+            {
+                //yz_quantity_0
+                GridView view = sender as GridView;
+                if (view.FocusedColumn.Tag != null && view.FocusedColumn.Tag.ToString().StartsWith("yz_"))
+                {
+                    string[] _ary = view.FocusedColumn.Tag.ToString().Split('_');
+                    if (_ary.Length > 2)
+                    {
+                        if (_ary[2] == "0")
+                        {
+                            double price = 0; if (!Double.TryParse(e.Value as String, out price))
+                            { e.Valid = false; e.ErrorText = "璇疯緭鍏ユ纭殑鏁板瓧."; }
+                            return;
+                        }
+                    }
+                }
+            };
         }
 
         #endregion
@@ -1440,29 +1460,7 @@
             return regex.IsMatch(str);
         }
 
-        /// <summary>
-        /// yz_quantity_0锛寉z_瀛楁_绫诲瀷
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        public static void SetValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e)
-        {
-            //yz_quantity_0
-            GridView view = sender as GridView;
-            if (view.FocusedColumn.Tag != null && view.FocusedColumn.Tag.ToString().StartsWith("yz_"))
-            {
-                string[] _ary = view.FocusedColumn.Tag.ToString().Split('_');
-                if (_ary.Length > 2)
-                {
-                    if (_ary[2] == "0")
-                    {
-                        double price = 0; if (!Double.TryParse(e.Value as String, out price))
-                        { e.Valid = false; e.ErrorText = "璇疯緭鍏ユ纭殑鏁板瓧."; }
-                        return;
-                    }
-                }
-            }
-        }
+      
 
     }
 

--
Gitblit v1.9.3