首页 > Windows开发 > 详细

【转】WPF 给DataGridTextColumn统一加上ToolTip

时间:2015-06-25 12:15:29      阅读:336      评论:0      收藏:0      [点我收藏+]

源地址:http://dongguojun.iteye.com/blog/1671963

我发现WPF中DataGridTextColumn直接设置它的ToolTipService.Tooltip并不好使,当然可以在这个列的CellStyle中再设置ToolTipService.Tooltip的值,这是管用的。但是当列比较多的时候,这样一一设置比较麻烦。下面介绍一个统一的设置方法,在DataGrid中统一设置CellStyle

<DataGrid.CellStyle>
      <Style TargetType="DataGridCell">
             <Setter Property="ToolTipService.ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content.Text}"/>
      </Style>
</DataGrid.CellStyle>

 

【转】WPF 给DataGridTextColumn统一加上ToolTip

原文:http://www.cnblogs.com/ZXdeveloper/p/4599500.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!