使用stringformat对齐右侧 [英] align to the right with stringformat
本文介绍了使用stringformat对齐右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
如何使用以下代码并右对齐
< pre lang =vb>< DataGridTextColumn x:Name = DG_MCash08标题= 金额宽度= 100 Binding = {Binding CURBASEAMOUNT,StringFormat ='{} {0: N2}'}
谢谢
解决方案
< DataGridTextColumn.CellStyle >
< 样式 TargetType =DataGridCell >
< Setter Property = HorizontalAlignment 值 = 正确 / >
< / Style >
< ; / DataGridTextColumn.CellStyle >
Hello,
How do I use the following code with align to the right
<DataGridTextColumn x:Name="DG_MCash08" Header="Amount" Width="100" Binding="{Binding CURBASEAMOUNT, StringFormat='{}{0:N2}'}"
Thank you
解决方案
<DataGridTextColumn.CellStyle> <Style TargetType="DataGridCell"> <Setter Property="HorizontalAlignment" Value="Right" /> </Style> </DataGridTextColumn.CellStyle>
这篇关于使用stringformat对齐右侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文