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)
5729
5729
{
5730
5730
bool focusLeftDataGrid = true ;
5731
5731
bool dataGridWillReceiveRoutedEvent = true ;
5732
+ DataGridColumn editingColumn = null ;
5732
5733
5733
5734
// Walk up the visual tree of the newly focused element
5734
5735
// to determine if focus is still within DataGrid.
@@ -5768,7 +5769,17 @@ private void DataGrid_LostFocus(object sender, RoutedEventArgs e)
5768
5769
focusedDependencyObject = parent ;
5769
5770
}
5770
5771
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 ) )
5772
5783
{
5773
5784
this . ContainsFocus = false ;
5774
5785
if ( this . EditingRow != null )
You can’t perform that action at this time.
0 commit comments