From 7f7b09f2cb3dbbdfe4a4bf078bfcde6cfbe76595 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期五, 08 八月 2025 15:45:35 +0800 Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient --- DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs | 37 +++++++++++++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 4 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs index b5d95cc..dcfa62a 100644 --- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs +++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work09.cs @@ -1,10 +1,12 @@ 锘縰sing System; using System.Collections.Generic; +using System.Data; +using System.Drawing; using System.IO.Ports; using System.Linq; -using System.Threading; using System.Timers; using System.Windows.Forms; +using DevExpress.Utils; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Newtonsoft.Json; @@ -19,6 +21,9 @@ /// 涓插彛绫� /// </summary> private SerialPort Sp = new SerialPort(); + /// <summary> + /// gridview瀹氭椂鍒锋柊 + /// </summary> System.Timers.Timer timer = new System.Timers.Timer(10000); public Frm_Work09() { @@ -35,7 +40,31 @@ }; GetComList(); this.comLine.getSuppler(""); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); + gvMx1.OptionsFind.ShowSearchNavButtons = false; + gvMx1.OptionsView.ShowAutoFilterRow = false; + gvMx1.OptionsView.ShowGroupPanel = false; + gvMx1.RowStyle += (s, e) => + { + //榛樿閫変腑琛屼笉鍙樿壊 + gvMx1.OptionsSelection.EnableAppearanceFocusedRow = false; + //榛樿閫変腑鍗曞厓鏍间笉鍙樿壊 + gvMx1.OptionsSelection.EnableAppearanceFocusedCell = false; + if (e.RowHandle >= 0) + { + DataRow row = gvMx1.GetDataRow(e.RowHandle); + if (row == null) + return; + string colorString = row["bgColor"].ToString(); // 浣跨敤鍗佸叚杩涘埗琛ㄧず棰滆壊鐨凙RGB鍊� + Color color = ColorTranslator.FromHtml(colorString); + e.Appearance.BackColor = color; + } + }; + gvMx1.IndicatorWidth = 60; + gvMx1.CustomDrawRowIndicator += (s, e) => + { + if (e.Info.IsRowIndicator && e.RowHandle >= 0) + e.Info.DisplayText = (e.RowHandle + 1).ToString(); + }; } /// <summary> @@ -137,7 +166,7 @@ } catch (Exception exe) { - LogHelper.Debug(this.ToString(), "鎵撳紑澶辫触:" + exe.Message); + LogHelper.Debug(this.ToString(), "鎵撳紑涓插彛閫氫俊澶辫触:" + exe.Message); Gs.DevApp.ToolBox.MsgHelper.ShowError("鎵撳紑澶辫触" + exe.Message); } } @@ -232,7 +261,7 @@ } catch (Exception ex) { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } -- Gitblit v1.9.3