Drop-Down Question - InfoPath Dev
in

InfoPath Dev

Drop-Down Question

Last post 06-13-2006 06:40 PM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-11-2006 11:23 PM

    Drop-Down Question

    I have a Data Connection to a Web Service (Recive data). my form contain a Drop-Down List control. I set the Drop List values to Look up values from web service (by the data connection).
    The values that the web service return are "a", "b", "c" and "d".

    1) When I open the form the first value that apper in the Drop List is "a". How can I change it (by code) to be somthing that not from the WS (such as "Choose Value")??

    2)When I open the Drop List optin I see a blank value on the top and after I see "b" , "c" and "d". What is this blank value?? I dont want it in my list. What to do?
  • 06-12-2006 12:26 PM In reply to

    Hi,

    I am not sure if I understand you correctly, but if you want the blank space to be replaced by "Choose Value", this is what you can do:
    1. In design mode (data source), double-click the drop down list whose default value you want to set.

    2. Inside the Field or group properties window, on the Data tab, under the Default Value field, enter your text (i.e. Choose Value), and then click OK.

    I hope this is helpful. :-)
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 06-13-2006 12:18 AM In reply to

    Not good. since my values came from data connection to a web service.
  • 06-13-2006 06:40 PM In reply to

    If you know what a value of the drop-down is going to be, you can do this, but if you don't know what they're going to be at design time (which is what it sounds like your dealing with), then you won't be able to do this. Instead, you could use rules or code.

    Rules:
    Tools -> Form Options -> Open and Save -> Rules
    Add Action -> Set a field's Value
    For the Value, select the node from the 2DS, this will automatically select the first node that is returned by the web service.

    You should be able to figure the code out from the above example, but if you're still having trouble, let us know!

    Good luck!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.