From 748cccedcafc39f0c4c2c7fc2b40843d8a886b17 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 16 Jan 2018 19:39:28 -0500 Subject: [PATCH] CellSelectionMapper removes row from selection map if no columns are selected --- .../Controls/DataGridEx/Model/IHandleCellSelection.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); } }