Kushal Tutorials - Document

Kushal Help| Parent-Child-Grid-Entry Form
Parent-Child Grid Entry:

Parent-Child Grid Entry form helps you to perform data manipulation on two selected tables with controls. In this form, one table is considered as a parent table and another one as a child table. Capturing Parent and Child Table information in one form is a common requirement in most of the database driven business applications.

For example, Invoice information will be saved in two tables, Invoice Master and Invoice Detail. While Invoice parent table stores Invoice Number, Invoice Date, Total Amount Etc, the Invoice child table stores multiple product information.

This form will represent all fields of the parent table with different types of controls depending on the field's data type. Display data over two data grids, one grid maps to parent table while the other grid maps to the child table. This form will also contain buttons with predefined actions like New, Save, Delete, Search, Export, Close for parent table operation, as well as Remove for child table operation.

Note: Kushal expects users to follow database design guidelines for making applications work.

For example single primary key for parent table and the composite primary key for child table.

Invoice Master

Id int(10) PK

Invoice Detail

Id int(10) PK

Invoice_Id int(10) PK , FK(Invoice Master)

Create Parent-Child Grid Entry Form

Click on New Form button.

Select Form type as Parent-Child Grid Entry.

Select Parent table Name in the drop-down. (Dropdown lists all tables from given database details)

Select the Primary Key Field.

Kushal automatically identifies the Sort field from the table as defined in the database and it sets the primary key. Sort Field can be selected from the Dropdown as shown below.

Select the Child Table Name in the drop-down. (Drop-down lists all tables from given database details)

Select the Primary Key Field.

Select the Foreign Key Field (Which is having a relation on parent table)

Check Use Title-Case [Link] to display the Table name in Title case.

CheckExclude table name in field names generated in new forms [Link] to exclude Table Name.

Click on Create button.

Kushal will create the User interface of the Form on the selected Table automatically. Further, you can modify the controls as per your requirement.

In Parent-Child Grid Entry Form, Kushal takes care of input validation, auto-incrementing of the primary key (both parent and child table), data filtering/mapping between parent and child table. Whenever you enter the data on the parent table's input controls and child table's data grid, Kushal maps foreign key and primary key to child records during the "Save" action. In addition to this, when you select the parent record, in child grid you get filtered data automatically.