Select Drop-Downs value

M

Mike B

I have a drop-down list box that I have manually populated. I am
trying to update what is displayed using custom code. I do not want to
change what is already present just change what is being displayed.

Basically, In the Drop down I have
Select... (Default)
A
B
C

With 1 Button I can change the Drop down to display A, with button 2 B,
Button 3 C, etc.

I have tried this in code, but all it seems to do is overwrite what I
already have there with what I have in my code.
this is what I have currently.
XDocument.DOM.selectSingleNode("//my:formStatus").text = "Working"

Originally the field was a text box but I decided to switch to a drop
down to enable using the status field in a conditional statement.

Thanks,
Mike
 
S

Scott L. Heim [MSFT]

Hi Mike,

I am not sure I am following what you need. If I place a drop-down list on
an InfoPath View and specify the values to be A, B or C, then I can
successfully set that control to any of those values using code like the
following:

XDocument.DOM.selectSingleNode("//my:field1").text = "B"

However, if I attempt to set the text value of this control to "Working" it
will fail as this is not a viable option in the list.

Is this what you are attempting or am I missing something?

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mike B

Scott,

Thanks for the reply. But I seem to have sent this too early. I found
my issue which was I had forgotten to fully populate my dropdown box.
I guess it is best not to rush and ask a question at the end of the
work day.

Thanks again.
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top