DataGrid: Headers and data columns not lined up.

Feb 24, 2010 at 9:10 PM

I keep getting this button in the header, I can click on the button to select all rows. This misaligns the data from the header. Any ideas?

http://picasaweb.google.com/lh/photo/CahvlINknhL5ykIW2zCfIw?feat=directlink

 

Mar 1, 2010 at 9:46 PM

I am having this problem too.  Not sure what the problem is, but I am sure it is something stupid that I've overlooked.  

Anyone know what this is?

 

Thank You

MEF

Mar 1, 2010 at 11:14 PM

For me the problem was caused by the Margin setting on the default style for buttons.

I solved it by starting with the code from this article:

http://sweux.com/blogs/smoura/index.php/wpf/2009/04/27/wpf-toolkit-datagrid-part-ii-custom-styling/

For the section maked <!--Left Column Header Corner --> in his sample resource dictionary I added [Margin="0"] to the Button.

Jonathan