wpf中ToolTip实现

定义样式:
<UserControl.Resources>
        <Style TargetType="DataGridCell" BasedOn="{StaticResource DefaultDataGridCellStyle}" x:Key="ToolTipsStyle">
            <Setter Property="ToolTipService.ToolTip" Value="{Binding Remark}" />
        </Style>
</UserControl.Resources>


然后再dataGrid中的列定义使用:
 CellStyle="{StaticResource ToolTipsStyle}" 

注意这里继承了DefaultDataGridCellStyle 

 

posted @ 2016-06-17 14:23  好人卡收藏家  阅读(905)  评论(0编辑  收藏  举报