如何在选择每行datagrid时更改文本块内容 [英] How to Change the textblock content when each row of datagrid is selected

查看:43
本文介绍了如何在选择每行datagrid时更改文本块内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格和一个文本块。

我必须在选择每一行时更改文本块的内容。我需要做什么?





在窗口初始化事件中,我已将datagrid绑定到itemssource。





请帮帮我!

I have a datagrid and a textblock.
I have to change the content of textblock when selecting each row. What i have to do?


In the window initialized event i have binded the datagrid with the itemssource.


Please help me!

推荐答案

这是你需要的事件:http://msdn.microsoft.com/en- us / library / system.windows.controls.datagrid.selectionchanged%28v = vs.95%29.aspx [ ^ ]。



这是您需要的属性: http:// msdn .microsoft.com / zh-cn / library / system.windows.controls.textblock.text.aspx [ ^ ]。



不是全部吗?

如果没有,您还需要: Microsoft Q209354 。 :-)



-SA
This is the event you need: http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.selectionchanged%28v=vs.95%29.aspx[^].

This is the property you need: http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.text.aspx[^].

Isn''t that all?
If not, you would also need this: Microsoft Q209354. :-)

—SA


这篇关于如何在选择每行datagrid时更改文本块内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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