WPF data grid - Column Header not aligned with data rows
- by Pawan
Hi,
I am using Datagrid in WPF. This is a very simple and basic implementation. I not using any styles.
I created a simple datagrid :
<dg:DataGrid x:Name="dg" >
</dg:DataGrid>
and populated it with data as:
dg.ItemsSource = " H E L L O W O R L D!".Split();
Grid gets properly populated but the columnheader of the grid is drawn with some offset. Due to this my data and header are mis aligned. I tried searching for this over net but I haven't found anything. This seems to be a straightforward implementation which is working for everyone except me :(.
Can anyone please tell me what might be going wrong? I have tried using different data sets and appyling some style to test this.
Thanks in advance.