silverlight 中datagrid列标题和列内容居中问题

silverlight 中datagrid列标题和列内容居中问题,第1张

概述http://www.soaspx.com/dotnet/silverlight/silverlight_20110102_7027.html 设置居中还要额外的加一个 命名空间:xmlns:Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data" 再通过定

http://www.soaspx.com/dotnet/silverlight/silverlight_20110102_7027.html

设置居中还要额外的加一个

命名空间:xmlns:Primitives="clr-namespace:System.windows.Controls.Primitives;assembly=System.windows.Controls.Data"

再通过定义统一资源样式

<Style x:Key="DataGrIDheaderStyle" targettype="Primitives:DataGrIDColumnheader">
                <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
            </Style>
            <Style x:Key="DataGrIDCellStyle" targettype="data:DataGrIDCell">
                <Setter Property="HorizontalContentAlignment" Value="Center" ></Setter>
            </Style>

然后在要居中的列引用这个样式如

 CellStyle="{StaticResource DataGrIDCellStyle}"

 headerStyle="{StaticResource DataGrIDheaderStyle}"这个是列头

总结

以上是内存溢出为你收集整理的silverlight 中datagrid列标题和列内容居中问题全部内容,希望文章能够帮你解决silverlight 中datagrid列标题和列内容居中问题所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1021693.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存