Skip to content

Commit d66cb04

Browse files
committed
Fix #7: fix did not apply if column header style of dg was set already explicit
1 parent c7d4177 commit d66cb04

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

DataGridExtensions/DataGridFilterHost.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ internal DataGridFilterHost([NotNull] DataGrid dataGrid)
6565

6666
dataGrid.Columns.CollectionChanged += Columns_CollectionChanged;
6767
dataGrid.Loaded += DataGrid_Loaded;
68+
dataGrid.CommandBindings.Add(new CommandBinding(DataGrid.SelectAllCommand, DataGrid_SelectAll));
6869

6970
if (dataGrid.ColumnHeaderStyle != null)
7071
return;
@@ -76,8 +77,6 @@ internal DataGridFilterHost([NotNull] DataGrid dataGrid)
7677
newStyle.Setters.Add(new Setter(Control.HorizontalContentAlignmentProperty, HorizontalAlignment.Stretch));
7778

7879
dataGrid.ColumnHeaderStyle = newStyle;
79-
80-
dataGrid.CommandBindings.Add(new CommandBinding(DataGrid.SelectAllCommand, DataGrid_SelectAll));
8180
}
8281

8382
/// <summary>

0 commit comments

Comments
 (0)