Any idea how you can fix this problem?
An alternative is to reverse the process: let the user enter the information into a form (not the table), then create a new row with the information when the user clicks the Add button. This also has the advantages of letting the user easily cancel the operation and of letting you validate the information before it gets to the model. If you add the row first and then edit directly in the table, it leads to the problems you are having and also makes it awkward for the user to back out.