Newbie here so go easy. I am using Visual Studio 2003 and Infopath. I access the a repeating table via OnAfterChange of one of the fields. When I insert a new row, I get the correct row number using
int rowNumber = e.Source.selectNodes("preceding-sibling::my:LeaveEntry/my:startDate").length + ...