Showing posts with label unaligned unalign aligned column header columnheader datacells cells shift shifted CellsPanelHorizontalOffset RowHeaderActualWidth. Show all posts
Showing posts with label unaligned unalign aligned column header columnheader datacells cells shift shifted CellsPanelHorizontalOffset RowHeaderActualWidth. Show all posts

Sunday, March 23, 2014

Unaligned Column Header with Data

I am very happy today that I solves a problem that I have been facing for a long time.
:->

When you have a custom control template, column headers will be shifted to the left unshowing the Select All button while the DataGrid cells manage to recognize the row header and shift correctly. Resulting in a column header that is not aligned with its corresponding cells.

CAUSE : some people would think it is the Visibility of the select all button but this is very untrue. The truth is that Width of this button is bound to an un-updated-properly property CellsPanelHorizontalOffset . Simply put , DataGrid fails to update this property accurately , ending up with value (most of the time) equals ZERO.

SOLUTION : bind the Select All button Width to RowHeaderActualWidth and enjoy the magic ;-)