Hi,
We can prevent the user to delete the row when there is only one row using the on before change event. Once follow the below code (This is in C#).
[InfoPathEventHandler(MatchPath = " /my:myFields/my:group1/my:group2", EventType = InfoPathEventType.OnBeforeChange)]
public void group2_OnBeforeChange(DataDOMEvent e)
{
if (e.Operation != "Insert" && thisXDocument.Dom.SelectNodes("/my:myFields/my:group1/my:group2").length == 0)
{
e.ReturnMessage = "Cannot delete the row.";
e.ReturnStatus = false;
}
}