如何向DataGridTextColumn添加工具提示 [英] How do I Add a Tooltip To a DataGridTextColumn

查看:141
本文介绍了如何向DataGridTextColumn添加工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WPFtoolkit DataGrid ,我必须在 DataGridTextColumn
中包装文本必须在文本列中添加一个 ToolTip 。我搜索了网络,但我无法得到一个正确的解决方案。期待您的宝贵建议...

解决方案

是的,您可以向DataGridTextColumn添加工具提示文本 - 只是将其设计为

 < DataGridTextColumn Header =ScreenNameBinding ={Binding ScreenName}> 
< DataGridTextColumn.CellStyle>
< Style TargetType =DataGridCell>
< Setter Property =ToolTipValue ={Binding Name}/>
< / Style>
< /DataGridTextColumn.CellStyle>
< / DataGridTextColumn>


I'm using WPFtoolkit DataGrid ,I have to wrap text in a DataGridTextColumn or I have to add a ToolTip to the text column. I have searched the net but i couldn't get a proper solution. Expecting your valuable suggestions...

解决方案

Yes, you can add tooltip text to DataGridTextColumn - just stylize it

<DataGridTextColumn Header="ScreenName" Binding="{Binding ScreenName}" >
    <DataGridTextColumn.CellStyle>
        <Style TargetType="DataGridCell">
            <Setter Property="ToolTip" Value="{Binding Name}" />
        </Style>
    </DataGridTextColumn.CellStyle>
</DataGridTextColumn>

这篇关于如何向DataGridTextColumn添加工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆