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) {