WPF DataGrid动态生成列的单元格背景色绑定

时间:2020-01-06 12:55:58   收藏:0   阅读:256
原文:WPF DataGrid动态生成列的单元格背景色绑定

技术分享图片
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Column.DisplayIndex}" Value="1">
  <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Self}, Path=Content.Text, 
Converter={StaticResource cellBackgroundConvert}}
"/> </DataTrigger>
技术分享图片

上面的是datagrid第一列的单元格背景色根据值改变。

原文:https://www.cnblogs.com/lonelyxmas/p/12155411.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!