Changing the control Template of a DataGrid
-
Hi all I have gone and created my own default control templates for a whole host of controls for example a nice rounded corner button and the different states for mouse hover and the like. The next control that I want to do this for is a data grid. I want to create my data grid with rounded corners and the same colour scheme so that it ties in with everything else. I started to play around with the control templates for DataGrid’s and got the rounded corners that I want but then I lost all the content of the grid. Even though I have the ContentPresenter there but still no luck so I must be doing something wrong. I’ve tried looking for an example of a control template for a DataGrid but haven’t been able to find what i’m doing wrong. I am wondering if anyone on here could shed some light. Below is the XAML from the resource dictionary that I am using so far. <Setter Property="OverridesDefaultStyle" Value="False" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type DataGrid}"> <Border Name="Border" CornerRadius="15" Margin="5" BorderBrush="{StaticResource StandardBorderBrush}" BorderThickness="2"> <ContentPresenter /> </Border> </ControlTemplate> </Setter.Value> </Setter> Some people are like slinky's... They're not really good for anything but they bring a smile to your face when pushed down the stairs