WPF DataGrid style-Silverlight DataGrid?

Viewed 14172

That's not a secret: Silverlight's DataGrid default style is beautiful while WPF's is poor.

Instead of reinventing the wheel let me ask the community if anyone has copied the SL styles to use in WPF.

Please take a look at the screenshots and judge for yourself how the Silverlight and WPF teams invest in their products.

Silverlight default-style DataGrid:

Silverlight DataGrid

WPF default-style DataGrid (updated after Saied K's answer):
WPF DataGrid

5 Answers

Buried deep within MSDN, I found this.

Toward the bottom of the article, you will see this phrase:

For example, take a look at the following illustration that shows part of the Styling with ControlTemplates Sample

If you click 'Styling with ControlTemplates Sample', it will take you to a download link. After download, you can compile the project and it includes all kinds of styles, including the elusive datagrid style! You can take MS's DataGrid.xaml file and modify it for your needs.

Seems there is not out-the-box style.
I posted a suggestion to Microsoft suggestions site, please vote here and here!!!

Anyone who has mimicked the Silverlight DataGrid default style to WPF should please post his answer and I will mark it as answer and give him a vote!

Thanks a lot!

WPF ships with a number of styles such as Luna, Aero, Classic, etc. These themes are applied based on your system settings. The screenshot from the previous post looks like the WPF Classic theme, but I'm guessing you're looking for a more appealing theme.

If you’re using a Classic system theme on your OS but would like your WPF application to use the Aero theme for example, you can add a merged dictionary to your app and force the Aero theme as shown below. Please note that you may need to change the binary version and public key accordingly.

<Application.Resources>
   <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
         <ResourceDictionary
             Source="/PresentationFramework.Aero;V4.0.0.0;31bf3856ad364e35;component\themes/aero.normalcolor.xaml"/>
      </ResourceDictionary.MergedDictionaries>
   </ResourceDictionary>
</Application.Resources>

Hope that helps, Saied K.

Related