Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Changing the control Template of a DataGrid

Changing the control Template of a DataGrid

Scheduled Pinned Locked Moved WCF and WF
wpfcsstutoriallearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gretna
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups