Click here to Skip to main content
14,929,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 15-Dec-09 1:14am
v2

1 solution

wrote:
Subdetail itemcode amount shouldn't exceed invoice amount


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.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900