Filling combo box items manually in a repeating grid - InfoPath Dev
in

InfoPath Dev

Filling combo box items manually in a repeating grid

Last post 11-06-2008 02:13 PM by jbobish. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-03-2008 10:30 AM

    Filling combo box items manually in a repeating grid

    I'm working on a form that will have a set of repeating rows.  In each row are two columns, each containing a dropdown listbox.  Selecting a value in the first dropdown will determine what items are available to be selected in the second dropdown.  All values come from a SQL Server database query.

    I need the form to be browser enabled and I believe that excludes me from using data source filters to accomplish this.

    In non-infopath C# I would just manually fill both dropdowns with values and have the on_changed event of the first dropdown contain code to populate the second dropdown.  I haven't been able to figure out how to do this within infopath.  Do any of you have any ideas?

    Thanks!

  • 11-06-2008 04:05 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Filling combo box items manually in a repeating grid

    Hello,

    If you enter dropdown values by manually for dropdown then we don't have option to filter those for second dropdown. For these you have to prepare one secondary xml file and take the connection as resource file or data connection.

    Go through the below link once,

    http://www.infopathdev.com/forums/p/6064/22601.aspx#22601

  • 11-06-2008 05:57 AM In reply to

    Re: Filling combo box items manually in a repeating grid

    I'm not 100% sure that the following would work on a browser-enabled form, but I have tried it on a regular form, and it works.

    Create a dummy XML file to use as a data source for the second dropdown box; something like:

    <?xml version="1.0">
    <dropdownEntries>
        <entry value="" display=""/>
        <entry value="" display=""/>
    </dropdownEntries>

    Then in the OnAfterChange event of the field bound to the first dropdown box, perform the following in code:

    1. Remove all entry nodes from <dropdownEntries>
    2. Add new nodes to <dropdownEntries> accordingly, based on the new selected value in the first dropdown box.

    If you would like an example of how to perform this in code (it's fairly simple), I'd be happy to provide it to you.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-06-2008 02:13 PM In reply to

    Re: Filling combo box items manually in a repeating grid

     Thanks guys, I believe this will work though I haven't implemented it yet.  I don't mind manually creating and changing the data source nodes in code now that I know that's how it must be done.

     

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