From af5cbbd06f9c007b1d82725b5bfecd82f35dc6bc Mon Sep 17 00:00:00 2001 From: zqm Date: Mon, 10 Nov 2025 11:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBtnDeleteTempDiff=5FClick?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=94=AF=E6=8C=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B0=8F=E4=B8=89=E8=A7=92=E4=BD=86=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E9=80=89=E4=B8=AD=E7=9A=84=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs index b818806..b13f4fd 100644 --- a/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs +++ b/Windows/CS/Framework4.0/Toprie/Toprie/Setting.cs @@ -557,7 +557,7 @@ namespace JoyD.Windows.CS { try { - // 只删除选中的温差图例 + // 检查是否有选中的行 if (dataGridViewTempDiff.SelectedRows.Count > 0) { // 获取选中行的索引 @@ -571,6 +571,20 @@ namespace JoyD.Windows.CS dataGridViewTempDiff.Rows.RemoveAt(selectedRowIndex); } } + // 额外检查:如果没有选中的行但有当前单元格(显示小三角的情况) + else if (dataGridViewTempDiff.CurrentCell != null && dataGridViewTempDiff.CurrentCell.RowIndex >= 0) + { + // 获取当前单元格所在行的索引 + int currentRowIndex = dataGridViewTempDiff.CurrentCell.RowIndex; + + // 从数据集合中删除该行数据 + if (currentRowIndex >= 0 && currentRowIndex < tempDiffData.Count) + { + tempDiffData.RemoveAt(currentRowIndex); + // 从DataGridView中删除该行 + dataGridViewTempDiff.Rows.RemoveAt(currentRowIndex); + } + } } catch (Exception ex) {