Delete Button on Repeating Table InfoPath 2010

This is kind of common request from client to have kind of small delete button or image in every to delete.

I couldn’t find any approach using Rules to delete the rows. One line C# code would do the trick J

 

Add Button and Click on the “Edit Form Code” in Button Properties.

 


public
void DeleteRow_Clicked(object sender, ClickedEventArgs e)

{


// Write your code here.

e.Source.DeleteSelf();

}

 

 

When delete the source for the button, it deletes the current node in the DOM, the node contains the entire row.

 

Download the sample Form with code here.

 

2 comments to Delete Button on Repeating Table InfoPath 2010

  • […] a quick bit of code I found on Uday’s mstechblog site that makes it a bit easier for your users to remove a row in a repeating table. Instead of […]

  • Neha

    If i have two repeating table in a section and each row has a delete button with same id for both repeating table then what should i do to delete the same row from both repeating tables with a single click…if i’m trying your above suggestion then it only deletes the row from one repeating table,not from both..

    Plz provide your valuable suggestions…its urgent..

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>