Remove DropDown Item Based on an (Existing Change Event and the Dropdowns Selected Value at the time) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Remove DropDown Item Based on an (Existing Change Event and the Dropdowns Selected Value at the time)

Last post 06-26-2009 06:27 AM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-25-2009 08:25 AM

    Remove DropDown Item Based on an (Existing Change Event and the Dropdowns Selected Value at the time)

    I basically have two versions of the form (look the same just about) that is controlled by a dropdown.  The values are New (default) and Extension.  When the user opens an existing form, and changes the value to Extension, others things happen and are already in place, such has changing text box values to old text box values and moving old end dates, to new start dates, etc.

    What I would like to do is with a dropdownlist called ddlPO.  If the original value was not = "NA", then I want "NA" removed from the dropdown list.  I'm kinda used to working with VB in .NET apps, but this is all in C# out of my comfort zone.

    I tried this:  ( it errors because these properties like Items and Selected value don't exist in this fashion)

    if
        thisXDocument.DOM.selectSingleNode("/my:myFields/my:ddlPO").SelectedValue != "NA";
    then
        thisXDocument.DOM.selectSingleNode("/my:myFields/my:ddlPO").Items.RemoveAt(thisXDocument.DOM.selectSingleNode("/my:myFields/my:ddlPO").Items.IndexOf(thisXDocument.DOM.selectSingleNode("/my:myFields/my:ddlPO").Items.FindByValue("NA")));

     

  • 06-26-2009 06:27 AM In reply to

    Re: Remove DropDown Item Based on an (Existing Change Event and the Dropdowns Selected Value at the time)

    Hi,

    Do one thing, add two drop down list boxes. One includes the value (which you want to remove from the drop down) and the other does not include this value. So conditionally hide one control and show the another control.

     

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.