数据绑定问题? [英] data binding problem?

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

问题描述

*我的数据库包含四个表(Product,ProductUnits,Invoice,InvoiceDetails)。

*表之间的关系如下

1- one-to-很多(Product-ProductUnits)

2-一对多(Invoice-InvoiceDetails)

3-一对多(InvoiceDetails-Product)

4-一对多(InvoiceDetails-ProductUnits)

*此数据库映射到实体模型。

*现在InvoiceDetails表包含 ProductID 作为外键, UnitID 也作为外键。

*我设定发票表格 InvoiceDetails 绑定到数据网格控件,产品和单位显示为下拉组合框。

*当我下拉单位组合框时,所有单位都会出现。

*问题??

*我希望与InvoiceDetails条目中当前产品相关的单位仅对用户显示组合框。

*如何将 InvoiceDetails.Units 绑定到InvoiceDetails行中的当前所选产品。

*I have data base that contain four tables (Product,ProductUnits,Invoice,InvoiceDetails) .
*Relations between tables as following
1- one-to-many (Product-ProductUnits)
2- one-to-many (Invoice-InvoiceDetails)
3- one-to-many (InvoiceDetails-Product)
4- one-to-many (InvoiceDetails-ProductUnits)
*This data base is mapped to entity model.
*Now InvoiceDetails table contain ProductID as foreign key and UnitID also as foreign key.
*I desigen Invoice form where InvoiceDetails is bound to data grid control ,product and units appear as drop down combo-box.
*All units appear when I drop down Units combobox.
*Question??
*I want units related to current product in InvoiceDetails entry only appear to user in combo-box.
*How can I bind InvoiceDetails.Units to current selected product in InvoiceDetails row.

推荐答案

为此,你应该在 SelectedIndexChanged Units DropDown $ c> 产品事件 DropDown。
For that, you should bind the Units DropDown inside the SelectedIndexChanged Event of the Products DropDown.


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

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