Skip to content

Commit 8273bca

Browse files
Update Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs
Co-authored-by: Rosario Pulella <Rosariopulella@gmail.com>
1 parent cefaeeb commit 8273bca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGridComboBoxColumn.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,13 @@ protected override void CancelCellEdit(FrameworkElement editingElement, object u
383383
/// <returns>The unedited value. </returns>
384384
protected override object PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs)
385385
{
386-
var comboBox = editingElement as ComboBox;
387-
if (comboBox != null)
386+
if(editingElement is ComboBox comboBox)
388387
{
389388
comboBox.IsDropDownOpen = true;
389+
return comboBox.SelectedItem;
390390
}
391391

392-
return comboBox?.SelectedItem;
392+
return null;
393393
}
394394

395395
/// <summary>

0 commit comments

Comments
 (0)