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.