在ComboBox上进行双数据绑定? [英] Double Data Bindings on ComboBox?

查看:137
本文介绍了在ComboBox上进行双数据绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直觉告诉我XAML允许在ComboBox上进行双重数据绑定,这仅仅是因为我需要首先从数据库中的表填充/显示数据,然后能够选择一个值以传递到数据网格中.如果我是正确的,那么哪些数据绑定是哪些?以身作则向我展示肯定可以.而且,根据您的答复,我可能还有其他问题.一如既往地谢谢您.

Intuition tells me XAML allows for double data bindings on a ComboBox simply because I need to first populate/display data from a table in my database and then be able to select a value to pass into a datagrid. If I am correct, then which data bindings are which? Showing me by example would definitely work. And, I may have more questions depending on your response. Thank you as always.

推荐答案

您的问题不是很清楚,但是如果您要设置显示值,请使用DisplayMemberPath 属性.

请参阅 http://msdn.microsoft.com/en-us/library /system.windows.controls.itemscontrol.displaymemberpath.aspx [ ^ ]

有一个ListBox的示例,但也有一个ComboBox 的示例.
Your question is not very clear, but if you mean setting the display value, then use the DisplayMemberPath property.

See http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.displaymemberpath.aspx[^]

The example there is for a ListBox, but it''s the same for a ComboBox too.


这篇关于在ComboBox上进行双数据绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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