Skip to content

Commit ec81edf

Browse files
authored
Fix DataGridTemplateColumn bug (#2898)
Add type check DataGrid columns for DataGridTemplateColumn in DataGridAssist. Fix bug where any controls within a cell of a DataGridTemplateColumn would not respond to the first click
1 parent 92e4e76 commit ec81edf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

MaterialDesignThemes.Wpf/DataGridAssist.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ private static void AllowDirectEditWithoutFocus(object sender, MouseButtonEventA
233233
if (dataGridCell.Content is UIElement element)
234234
{
235235
var dataGrid = (DataGrid)sender;
236+
// If it is a DataGridTemplateColumn we want the
237+
// click to be handled naturally by the control
238+
if (dataGridCell.Column.GetType() == typeof(DataGridTemplateColumn))
239+
{
240+
return;
241+
}
236242
if (dataGridCell.IsEditing)
237243
{
238244
// If the cell is already being edited, we don't want to (re)start editing

0 commit comments

Comments
 (0)