Skinning DataGrid

Aug 21, 2008 at 3:38 PM
Hello,
I was skinning DataGrid and i've run to a little problem. I wasn't able to remove(set to transparent) that white background under column headers(grids background is transparent and that gray textured background is applied to whole form).

Free Image Hosting at www.ImageShack.us

I really need to remove that so if anybody can help me please. I was trying to edit the sources but still no result (i'm not skilled enough i think). And it will be also nice to enable other developers to skin even this part.
I haven't got through there but i think the same applies to the row headers.

Thanks Jan Dryk
Aug 22, 2008 at 10:12 AM

Hallo Jan,

the screenshot looks nice. Are you able to publish your xaml style file? I would appreciate it !
I have just begun to evaluate the DataGrid and currently I have no idea where to start!

Thank you

Michael

Aug 22, 2008 at 11:28 AM
Thanks but this style is based mainly on transparency and with that damn white background i can't use it.
It is a  whole library of controls that i want to use for my apps.

There are sources:
http://rapidshare.com/files/139216834/SkinnedDataGrid.rar
Maybe you can help me with my little white problem :-)

Regards Jan Dryk
Aug 22, 2008 at 3:21 PM
Hallo Jan,
thank you for the code (xaml) example. I analyzed it with Snoop (by the way: great tool) and came to the conclusion that there is a gray button under the header controls. In snoop you can see the following (partial) visual tree:

- DataGrid
  - Border
    - ScrollViewer
      - Grid
        - Button (with a gray background)
          - Grid
            - Border (Rectangle)
            - Arrow (Polygon)

I also found out that setting another theme changes the appearance (As you would expect it).
It seems to me that the class DataGridHeaderBorder has something to do with that: It draws the background depending on the theme.
Unfortunately I couldn't figure out if you can set that background to "Transparent".

Hope that helps a little anyway.
Michael
Aug 23, 2008 at 9:38 AM
Hi,
Thanks really much, i'll look into it but there are some ideas i haven't checked out.
I'll keep you posted if it worked and maybe upload finished code if you want?
 
Thanks Jan Dryk
Aug 23, 2008 at 12:41 PM
Hi,
 I've sorted it out by deleting all the theme stuff in the DataGridHeaderBorder class.
Now to make it finished i need to do two more things - the rows number to the row header and skin it. I don't know how to do that yet but i hope i'll figure out.
Thanks a lot for all your help.
Jan Dryk