Deleting multiple rows from a repeating table - InfoPath Dev
in

InfoPath Dev

Deleting multiple rows from a repeating table

Last post 12-30-2009 01:09 AM by Qazi Anis. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-28-2009 09:57 AM

    Deleting multiple rows from a repeating table

    I have a repeating table that has a checkbox on each row.  If checked, the user can press a button (outside the repeating table) and delete all the records that has the checkbox checked. 

    Here's what i have but it stops after deleting the first row it finds.  How do i make it continue to loop through each row after deleting a row???  Here's my code... c#

     

    public void btn_RemoveRows_Clicked(object sender, ClickedEventArgs e)

    {

    // Write your code here.

    XPathNodeIterator table = MainDataSource.CreateNavigator().Select("/dfs:myFields/dfs:dataFields/d:FACILITY_SELECTION", this.NamespaceManager);

    string totalRows = table.Count.ToString();

    foreach (XPathNavigator row in table)

    {

    string chkbox = row.SelectSingleNode("@Selection_Chkbox", this.NamespaceManager).Value;if (chkbox == "1")

    {

    row.DeleteRange(row);

    }

    }

    }

  • 12-28-2009 08:39 PM In reply to

    Re: Deleting multiple rows from a repeating table

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 12-29-2009 07:29 AM In reply to

    Re: Deleting multiple rows from a repeating table

    Sorta... I know how to delete all rows in a table.  But i'm talking about deleting certain multiple rows. 

    Example:

    row #1 is checked, row #2 isn't checked, row #3 is checked, row #4 isn't checked.

    click button, and delete ONLY row #1 & #3 because they were checked.

  • 12-30-2009 01:09 AM In reply to

    Re: Deleting multiple rows from a repeating table

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.