gpt4 book ai didi

wpf - 向 DataGridTextColumn 添加边距

转载 作者:行者123 更新时间:2023-12-04 00:02:15 26 4
gpt4 key购买 nike

如何向 DataGridTextColumn 添加边距或填充?

最佳答案

没有示例代码的答案不是很有帮助。用这个:

<DataGridTextColumn Header="Name" Binding="{Binding Name}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="5" />
<Setter Property="Padding" Value="10" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
x前缀来自 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" .我使用了一个具有公共(public) Name 的业务对象属性(property)。

关于wpf - 向 DataGridTextColumn 添加边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8575953/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com