Skip to content

Commit cefaeeb

Browse files
committed
Improving ComboBoxColumn behavior to prevent need to click a ComboBox 3 times for DropDown expansion
1 parent eff2ee5 commit cefaeeb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +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-
return (editingElement as ComboBox)?.SelectedItem;
386+
var comboBox = editingElement as ComboBox;
387+
if (comboBox != null)
388+
{
389+
comboBox.IsDropDownOpen = true;
390+
}
391+
392+
return comboBox?.SelectedItem;
387393
}
388394

389395
/// <summary>

0 commit comments

Comments
 (0)