I have problem about when insert row into repeating table. - InfoPath Dev
in

InfoPath Dev

I have problem about when insert row into repeating table.

Last post 10-07-2007 11:41 PM by jatuphum. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-04-2007 12:36 AM

    I have problem about when insert row into repeating table.

    Hi. 

    I have some problem about insert new row into repeating table. This is my code (event onclick from button).

    public void btnCustom_Clicked(object sender, ClickedEventArgs e)

    {

    XPathNavigator row = this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:FormStatus", NamespaceManager);

    row.Clone();

    row.SelectSingleNode(
    "my:StatusName", NamespaceManager).SetValue("Created");

    row.SelectSingleNode("my:StatusDatetime", NamespaceManager).SetValue(DateTime.Now.ToString("dd MMMM yy HH:mm:ss"));

    XPathNavigator parent = this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields", NamespaceManager);

    parent.AppendChild(row);

     

    }

    When I click button at first time, number of row that insert into table is double (This's not Ok). After first time number of row that insert is single (This's ok.)

    How can I solve this problem

    Thank you very much.

    インフォパス ● デべロッパー
  • 10-04-2007 05:14 AM In reply to

    Re: I have problem about when insert row into repeating table.

    Is the repeating table blank at first?

    Inorder to clone there has to be something to clone.  You either need to have a blank exisitng row, which you could hide, or you code to check for no rows and only insert the first one and then clone after the first one exists.

    I have seen this discussed before and would guess that is the case for you if it is empty to start.

  • 10-04-2007 05:58 AM In reply to

    Re: I have problem about when insert row into repeating table.

    Thank you for your response again, Fox. :)

    Yes, you right. I don't have something before insert row. With this repeating table, I want to insert only by Coding but not by user.

    How I could hide or remove blank row before insert new row.

    Thank You very much. 

    インフォパス ● デべロッパー
  • 10-04-2007 06:20 AM In reply to

    Re: I have problem about when insert row into repeating table.

    If you have any default values then the initial row could be blank and you could have conditional formatting that said if field is blank hide.  Otherwise you might put an aditional flag field or have a certain value in a field which you could use to hide the row upon. FieldX = Hide - Hide

  • 10-04-2007 09:45 AM In reply to

    Re: I have problem about when insert row into repeating table.

    Hi, Fox.

    I didn't have default value for setting blank row. Because I want to set it after user submit form. By value that is set to field in repeating table, it upto button click such as "created" or "modified" or "approved" and etc. How should I do for hide blank row or remove it from repeating table.

     Thank you very much.

    インフォパス ● デべロッパー
  • 10-07-2007 11:41 PM In reply to

    Re: I have problem about when insert row into repeating table.

    Now, I try to add new row in repeating table by check row count before on Form Load. And New row that I insert is first row of repeating table.

    I hope when I submit , I set field value of repeating table (at rule screen). But In fact, When I submit form, this field was updated by new value in every record.

    If I don't have any solution, I must add new row by managed code , right?

    Thank you.

    インフォパス ● デべロッパー
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.