Silverlight DataGrid Header Horizontal Alignment

前端 未结 3 1054
别跟我提以往
别跟我提以往 2021-01-05 17:57

I want to change the alignment of a header on a datagrid in Silverlight, and I can\'t seem to figure out how to do it. Here\'s what I have so far:

  

        
3条回答
  •  清酒与你
    2021-01-05 18:12

    It seems that this approach sorta works but you get the default header, right aligned. I have a static resource style for the datagridcolumnheader and I only want to change the alignment leaving all the other style elements as contained in the custom style. So far I have:

    xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:prim="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"

    and

    and

    Resizing the grid shows the text is right aligned but the font, background, etc are not as defined in DataGridColHeaderStyle

    Thanks

提交回复
热议问题