Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix DataGridTemplateColumn bug
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
  • Loading branch information
amescodes committed Oct 4, 2022
commit eaf834decc39e7f6bae66a4074273c6e77cb2dc7
6 changes: 6 additions & 0 deletions MaterialDesignThemes.Wpf/DataGridAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ private static void AllowDirectEditWithoutFocus(object sender, MouseButtonEventA
if (dataGridCell.Content is UIElement element)
{
var dataGrid = (DataGrid)sender;
// If it is a DataGridTemplateColumn we want the
// click to be handled naturally by the control
if (dataGridCell.Column.GetType() == typeof(DataGridTemplateColumn))
{
return;
}
if (dataGridCell.IsEditing)
{
// If the cell is already being edited, we don't want to (re)start editing
Expand Down