回复 3楼CP32014的帖子
根据你的代码,可以设置列的HeaderStyle。
代码参考:
- <my:DataGridTextColumn Header="编号" Binding="{Binding Path=ID}" >
- <my:DataGridTextColumn.HeaderStyle>
- <Style TargetType="{x:Type my:DataGridColumnHeaderPresenter}">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- </Style>
- </my:DataGridTextColumn.HeaderStyle>
- </my:DataGridTextColumn>
复制代码 |