Nick Williams
Nick Williams

Reputation: 1267

MahApps Metro and DataGridExtensions

In a project that I am starting I am using the 2 following libraries:

MahApps.Metro - http://mahapps.com/MahApps.Metro/

DataGridExtensions - https://github.com/dotnet/DataGridExtensions

DatagridExtensions has some pretty nice datagrid filtering tools. The only problem is that using it removes the Metro style from the datagrid. Is there any way I can keep the Metro Styling on the datagrid and use the extensions.

The only .xaml file I could find in the DataGridExtensions library was the generic.xaml file. I modified this to include BasedOn in any styles in there, as this has worked in the past:

e.g.

<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}>

Upvotes: 10

Views: 2807

Answers (1)

Lucas Trzesniewski
Lucas Trzesniewski

Reputation: 51330

Setting a default header style solved the problem for me:

<Style TargetType="{x:Type DataGridColumnHeader}"
       BasedOn="{StaticResource MetroDataGridColumnHeader}" />

Upvotes: 4

Related Questions