Sorting drop-down list box - InfoPath Dev
in

InfoPath Dev

Sorting drop-down list box

Last post 02-11-2009 07:20 AM by discodave82. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-18-2005 01:58 AM

    • IritP
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 3

    Sorting drop-down list box

    Hi,

    I design a form that gets it data from SharePoint lists and in the save commend it generate a form to SharePoint form library.

    In my form there are 2 drop-down list boxes that gets there data from the same SharePoint list. That list contains a name and number and it sorted in SharePoint by the name.

    Because I want that when I choose name in the first drop-down list box, I will get the relevant number in the second drop-down list box and vice versa, I created 2 different data connections, and add rules to set the other field.

    All that works fine.

    Now I want to sort the number drop-down list box. I cant sort it in the SharePoint because then I will have the same problem with the name drop-down list box.

    Are there any suggestions?
  • 08-08-2006 08:14 PM In reply to

    Re: Sorting drop-down list box

    Unfortunately this requires code. Fortunately becuase you created 2 different data connections you can write code to sort the data in the data connection you're using for the number dropdown. You will have to put this in your OnLoad or in your onAfterChange event for the first dropdown to be sure it happens after the query has been executed OnLoad. Then the values in the number dropdown will be in the order you desire.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-15-2008 08:51 AM In reply to

    Re: Sorting drop-down list box

    Is there any way to sort a secondary data source in Browser Enabled form? I have a form with mulitple views, and in order to create a preserve code block I have to go and edit all XSL sheets that correspond that form. I'm populating a dropdown menu from a SharePoint List, in the thick client (Info Path) the form appears and renders the sort order that is being used from my SharePoint view. I've have created a preserve code block, but that feature is not supported in a browser enabled form.       

  • 12-15-2008 09:35 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Sorting drop-down list box

  • 12-15-2008 10:10 PM In reply to

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

    Re: Sorting drop-down list box

    Hello,

    We can sort using the below code,

    ArrayList sortValues = new ArrayList();

    foreach(IXMLDOMNode repeatingNode in repeatingNodes)

    {

    sortValues.Add(repeatingNode.xml);

    }

    sortValues.Sort();

    Using above code it will sort by order and we have to replace old repeating section nodes with new repeating section nodes.

    You can use this when you want to sort those values in OnLoad or OnClick event of button.

  • 12-16-2008 07:04 AM In reply to

    Re: Sorting drop-down list box

    I'm new to InoPath... can you explain to me the steps neccesary to make this happen?

  • 02-11-2009 07:20 AM In reply to

    Re: Sorting drop-down list box

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