Jul 13

Infopath “Delete Row” button

Here’s a quick bit of code I found on Uday’s mstechblogs site that makes it a bit easier for your users to remove a row in a repeating table. 

 To use this in your form:

  • Add a button
  • Access the button properties
  • Fill out the Label and ID fields, then select “Edit Form Code…”
  • Find the code for your button’s clicked event
  • Add this short line of code after the comment line:
    • // Write your code here.
      e.Source.DeleteSelf();

And that’s it. Preview your form and add a series of extra rows in the table. A click of your new button and the line will be gone. Makes things easier for end users; they just click a shiny button instead of using the table menu to remove each repeating row.