editable grid

I have a CDT declared as ri!input.

The expectation is to create a section with text field which would have 1 value from cdt.(user value as per below image)

The rest of values of the cdt is gotten via the grid layout.(countries, home country)

I face an issue when i update a value in the text field , automatically a row gets added in the grid row layout as highlighted below.

As one value is procured in the text field it expects value in the grid also to be populated.

please let me know how this can be fixed as the text value is required field not the grid layout would be mandatory

As this row is automatically added it interrupts the validations. 

I have tried to save the value in the ri variable in child form and dealt with local variable in parent form but no luck. Also the value when got from the local does not display in subforms in PMs

The ask is if the user field is updated and if no values in the grid then the user value should be added to cdt but should not display any empty column below

kindly assist

If not how to hide this empty row as it clashes with header cells when i apply at component level

  Discussion posts and replies are publicly visible