如何在wpf中设置datagrid工具提示内的datagrid的datacontext [英] How to set the datacontext of datagrid which is inside the datagrid tooltip in wpf

查看:452
本文介绍了如何在wpf中设置datagrid工具提示内的datagrid的datacontext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< setter property =ToolTip>

< setter.value>

<! - < usercontrol> - >

< datagrid name =dgDTC>


解决方案

我不认为你需要设置,默认情况下,子控件采用Parent控件的上下文。



如果你想要一个单独的上下文,那么在加载子控件时添加数据上下文。

<setter property="ToolTip">
<setter.value>
<!--<usercontrol>-->
<datagrid name="dgDTC">

解决方案

I don't think you need to set, by default the child control takes the context of the Parent control.

If you want a separate context then on load of the child control add the data context.


这篇关于如何在wpf中设置datagrid工具提示内的datagrid的datacontext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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