File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -5729,6 +5729,7 @@ private void DataGrid_LostFocus(object sender, RoutedEventArgs e)
57295729 {
57305730 bool focusLeftDataGrid = true ;
57315731 bool dataGridWillReceiveRoutedEvent = true ;
5732+ DataGridColumn editingColumn = null ;
57325733
57335734 // Walk up the visual tree of the newly focused element
57345735 // to determine if focus is still within DataGrid.
@@ -5768,7 +5769,17 @@ private void DataGrid_LostFocus(object sender, RoutedEventArgs e)
57685769 focusedDependencyObject = parent ;
57695770 }
57705771
5771- if ( focusLeftDataGrid )
5772+ if ( this . EditingRow != null && this . EditingColumnIndex != - 1 )
5773+ {
5774+ editingColumn = this . ColumnsItemsInternal [ this . EditingColumnIndex ] ;
5775+
5776+ if ( focusLeftDataGrid && editingColumn is DataGridTemplateColumn )
5777+ {
5778+ dataGridWillReceiveRoutedEvent = false ;
5779+ }
5780+ }
5781+
5782+ if ( focusLeftDataGrid && ! ( editingColumn is DataGridTemplateColumn ) )
57725783 {
57735784 this . ContainsFocus = false ;
57745785 if ( this . EditingRow != null )
You can’t perform that action at this time.
0 commit comments