数据表/DGV父子关系

编程入门 行业动态 更新时间:2024-10-27 00:36:00
本文介绍了数据表/DGV父子关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

伙计们 我的要求是在一个父数据表中获取发票详细信息(即发票编号,供应商名称,发票金额,日期).然后,该子明细会显示在另一个数据表中(即发票编号,项目代码,金额等).关系是发票编号.我需要直接从datagridview获取输入.子明细项目代码金额不应超过发票金额. DGV应该以添加方式显示父表,一旦我在父表中添加了详细信息,该行之前就会出现一个加号,按该加号我应该能够直接输入子表的详细信息. 有人可以帮助我如何从DGV获得这些输入.示例代码确实有帮助 在此先感谢 问候 Mohamed Faizal

Hi Guys My requirement is to get Invoice details in one parent datatable (i.e. Invoice number, Vendor Name, Inv amount, Date). Then the subdetails in another datatable (i.e. invoice number, itemcode, amount, etc). The relation is Invoice Number. I need to get the input directly from a datagridview. Subdetail itemcode amount shouldn''t exceed invoice amount. The DGV should display the parent table in add mode, once i addded the details in parent table a plus symbol should appear before that row, pressing that plus symbol i should able to enter child table details directly. Can someone help how do i get these inputs from a DGV. Sample code would really help Thanks in advance Regards Mohamed Faizal

推荐答案

写道:​​

子明细项目代码金额不应超过发票金额

Subdetail itemcode amount shouldn''t exceed invoice amount

插入记录时应进行此检查.不是吗? 如果您的应用程序处理的数据量不太高,则应一次性获得整个父级和子级数据.然后,使用RowEnter或SelectionChanged事件,您可以基于选择内容过滤掉子表中的数据.然后,您可以使用该子数据进行显示/验证.

This check should be done while inserting the records. Isn''t it? If the amount of data your application deals with is not too high, you should get entire parent and the child data in one go. Then, using RowEnter or SelectionChanged event, you can filter out the data in the child table based on the selection. Then you can use that child data for displaying/validation.

更多推荐

数据表/DGV父子关系

本文发布于:2023-10-25 00:15:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1525396.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:父子   数据表   关系   DGV

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!