From 7e032e5eafc16d982d09275d3692b1a2d06875a2 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 10 一月 2025 11:17:00 +0800
Subject: [PATCH] 细节

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

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index f103276..ce148f8 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -454,14 +454,7 @@
                             txt.Enabled = !isEdt;
                             continue;
                         }
-                        //if (colType is CheckEdit)
-                        //{
-                        //    var txt = colType as CheckEdit;
-                        //    if (txt != null)
-                        //        txt.Checked = bool.Parse(strVal);
-                        //    txt.ReadOnly = isEdt;
-                        //    continue;
-                        //}
+
                         //鏃堕棿
                         if (colType is DateTimePicker)
                         {
@@ -772,14 +765,7 @@
                         txt.ReadOnly = isEdt;
                     continue;
                 }
-                if (ctrl is MemoEdit)
-                {
-                    var txt = ctrl as MemoEdit;
-                    if (txt != null)
-                        txt.Text = "";
-                    txt.ReadOnly = isEdt;
-                    continue;
-                }
+
                 //鏃堕棿
                 if (ctrl is DateTimePicker)
                 {
@@ -930,7 +916,7 @@
                 }
             }
         }
-      
+
         /// <summary>
         ///     绂佺敤鎴栧惎鐢ㄥ鍣ㄩ噷闈㈢殑鎺т欢
         /// </summary>
@@ -1182,15 +1168,15 @@
             }
         }
 
-        private static bool _isRead(object obj,bool isEdt=false)
+        private static bool _isRead(object obj, bool isEdt = false)
         {
             ///姘歌繙鏄彧璇荤殑
-            if (obj != null && obj.ToString().ToUpper()==("readOnly".ToUpper()))
+            if (obj != null && obj.ToString().ToUpper() == ("readOnly".ToUpper()))
             {
                 return true;
             }
             ///姘歌繙鏄彲鍐欑殑
-            if (obj != null && obj.ToString().ToUpper()==("readOnly-1".ToUpper()))
+            if (obj != null && obj.ToString().ToUpper() == ("readOnly-1".ToUpper()))
             {
                 return false;
             }
@@ -1666,6 +1652,7 @@
         public static void SetGridViewParameter(GridView gridView1, PictureBox picCheckBox = null, Form fm = null, string fileName = "checkStatus", string icoName = "", DelegateGetModel action = null)
         {
             gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀
+            // gridView1.BestFitColumns();//鏁版嵁缁戝畾鍒癎ridView涔嬪悗璋冪敤BestFitColumns()鏂规硶
             foreach (GridColumn column in gridView1.Columns)
             {
                 column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
@@ -1728,7 +1715,26 @@
                         view.ActiveEditor.MouseUp += ActiveEditor_MouseUp;
                 };
             }
-
+            gridView1.RowStyle += (s, e) =>
+            {
+                gridView1.OptionsSelection.EnableAppearanceFocusedRow = false;//榛樿閫変腑琛屼笉鍙樿壊
+                gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;//榛樿閫変腑鍗曞厓鏍间笉鍙樿壊
+                if (e.RowHandle >= 0)
+                {
+                    DataRow row = gridView1.GetDataRow(e.RowHandle);
+                    if (row == null)
+                        return;
+                    bool columnExists = row.Table.Columns.Contains("isRed");
+                    if (columnExists == true)
+                    {
+                        string _isRed = row["isRed"].ToString();
+                        if (_isRed == "1")
+                        {
+                            e.Appearance.BackColor = Color.LightPink;
+                        }
+                    }
+                }
+            };
         }
         private static void ActiveEditor_MouseUp(object sender, MouseEventArgs e)
         {

--
Gitblit v1.9.3