Hi Dave, I like your DataGrid style for MahApps.Metro. I'm using MahApps.Metro version 0.12.1.0 installed via NuGet. Can you please explain how I can use your version?
This style got accepted into MahApps.Metro, so you just need to enable it. In the file where you are including Controls.xaml from MahApps.Metro (likely your App.xaml or MainWindow.xaml), you need to add the following to your resources if you want every DataGrid to have that style:
or just manually set the style on each DataGrid as required (as in the MetroDemo example here: https://github.com/MahApps/MahApps.Metro/blob/master/samples/MetroDemo/MainWindow.xaml#L1158)
Hi Bart and Dave, I am doing the same thing but the styles do not apply for some reason. I am getting a completely white grid without any colors or effects. Could you please suggest what am I missing. I downloaded mahapps from nuget with -pre argument for pre-release version.
Hi Dave,
ReplyDeleteI like your DataGrid style for MahApps.Metro.
I'm using MahApps.Metro version 0.12.1.0 installed via NuGet.
Can you please explain how I can use your version?
Hi Bart,
ReplyDeleteThis style got accepted into MahApps.Metro, so you just need to enable it. In the file where you are including Controls.xaml from MahApps.Metro (likely your App.xaml or MainWindow.xaml), you need to add the following to your resources if you want every DataGrid to have that style:
<Style TargetType="DataGrid" BasedOn="{StaticResource AzureDataGrid}" />
or just manually set the style on each DataGrid as required (as in the MetroDemo example here: https://github.com/MahApps/MahApps.Metro/blob/master/samples/MetroDemo/MainWindow.xaml#L1158)
I hope this helps.
Hi Bart and Dave,
ReplyDeleteI am doing the same thing but the styles do not apply for some reason. I am getting a completely white grid without any colors or effects. Could you please suggest what am I missing. I downloaded mahapps from nuget with -pre argument for pre-release version.
Hi, sorry, not sure what it could be without seeing your code. I suggest you check out the official documentation here:
ReplyDeletehttp://mahapps.com/controls/datagrid.html
You can also check the sample app code on github:
https://github.com/MahApps/MahApps.Metro/tree/master/samples/MetroDemo