diff --git a/src/client/spark/view/Controls/DataGridEx/Model/IHandleCellSelection.cs b/src/client/spark/view/Controls/DataGridEx/Model/IHandleCellSelection.cs index b01d96115..169625bb2 100644 --- a/src/client/spark/view/Controls/DataGridEx/Model/IHandleCellSelection.cs +++ b/src/client/spark/view/Controls/DataGridEx/Model/IHandleCellSelection.cs @@ -17,7 +17,11 @@ namespace mbts.ui.controls HashSet cols; if (selection_map.TryGetValue(row, out cols)) { object ck = DataGridEx.GetCellKey(cell_info.Column); - if (ck is TCol) cols.Remove((TCol)ck); + if (ck is TCol) { + cols.Remove((TCol)ck); + if (cols.Count == 0) + selection_map.Remove(row); + } } } } @@ -27,7 +31,8 @@ namespace mbts.ui.controls object ck = DataGridEx.GetCellKey(cell_info.Column); if (ck is TCol) { HashSet cols; - if (!selection_map.TryGetValue(row, out cols)) selection_map.Add(row, cols = new HashSet()); + if (!selection_map.TryGetValue(row, out cols)) + selection_map.Add(row, cols = new HashSet()); cols.Add((TCol)ck); } }