Silverlight DataGrid 标题水平对齐方式 [英] Silverlight DataGrid Header Horizontal Alignment
本文介绍了Silverlight DataGrid 标题水平对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 Silverlight 中更改数据网格上标题的对齐方式,但我似乎不知道该怎么做.这是我到目前为止所拥有的:
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:
<data:DataGridTextColumn Header="#"
IsReadOnly="True"
ElementStyle="{StaticResource CenterAlignStyle}"
Binding="{Binding OutlineNumber, Mode=OneWay}" >
<data:DataGridTextColumn.HeaderStyle>
<Style TargetType="prim:DataGridColumnHeader">
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</data:DataGridTextColumn.HeaderStyle>
</data:DataGridTextColumn>
无论我怎么尝试,似乎都无法更改默认对齐方式,看起来是左".
No matter what I try, I can't seem to change the default alignment, which appears to be "left."
推荐答案
你真的很亲近,其:-
<Setter Property="HorizontalContentAlignment" Value="Center"/>
这篇关于Silverlight DataGrid 标题水平对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文