Skip to content

Commit 65870f3

Browse files
committed
Add workaround for removal of GraphicalWatch DataGrid elements (non-selectable empty last element).
1 parent 5e2be04 commit 65870f3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Visual_Studio_2015/GraphicalDebugging/GraphicalWatchControl.xaml.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,18 @@ private void dataGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEven
121121
return;
122122

123123
int selectIndex = -1;
124-
Util.RemoveDataGridItems(dataGrid,
125-
Variables,
126-
delegate (GraphicalItem variable) { },
127-
out selectIndex);
124+
bool removed = Util.RemoveDataGridItems(dataGrid,
125+
Variables,
126+
delegate (GraphicalItem variable) { },
127+
out selectIndex);
128+
129+
if (removed)
130+
{
131+
if (selectIndex >= 0 && selectIndex == Variables.Count - 1)
132+
{
133+
ResetAt(new GraphicalItem(), selectIndex);
134+
}
135+
}
128136

129137
Util.SelectDataGridItem(dataGrid, selectIndex);
130138
}

0 commit comments

Comments
 (0)