how can I hide repeating bulleted list programmatically when list is blank - InfoPath Dev
in

InfoPath Dev

how can I hide repeating bulleted list programmatically when list is blank

Last post 08-23-2010 07:45 AM by rZ3A8zj8neCW3K. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-11-2010 01:39 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    how can I hide repeating bulleted list programmatically when list is blank

    Is there a way to hide a repeating bulleted list item in InfoPath 2007 form with C#, when the list item is blank?  My form has several sections with repeating bulleted lists but not every bullet item is populated.  The problem occurs when the form is previewed or printed, if a particular repeating bulleted list is not used (populated with text) then the line item (bullet) shows with the empty list.  My expectation is to only have the bullet show if the list contains some text.  If nothing is typed in, then I want to hide that bullet.

     I can only see a way to hide a repeating list on the condition that another control contains some data...but I want the control to hide if its empty.  Built in rules/condidtions don't seem to allow that.

  • 08-11-2010 06:30 PM In reply to

    Re: how can I hide repeating bulleted list programmatically when list is blank

     Hi Doreen, you can replace your repeattind bulleted by a repeating table and use conditionnal formatting to hide the blank field.

  • 08-23-2010 07:45 AM In reply to

    Re: how can I hide repeating bulleted list programmatically when list is blank

    This might work for you, it's some code I have to empty a repeating section, which should be similar:

    private void clearRepeatingGroup()
            {
                //The following block of code empties the repeating section when the form that is chosen changes           
                bool continueDeleteNodes = true;
                while (continueDeleteNodes)
                {
                    try
                    {
                        this.getNode(CODED_REPEATING_SECTION_XPATH + "[1]").DeleteSelf();
                    }
                    catch (Exception)
                    {
                        continueDeleteNodes = false;
                    }
                }
            }

    the CODED_REPEATING_SECTION_XPATH is just a hardcoded string, it can be any XPath (e.g. /my:myFields/my:data/my:myRepeatingBulletedList)

     

    - rZ3A8zj8neCW3K
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.