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
Scott L. Heim [MSFT] - 29 Jun 2005 22:55 GMT
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
Mike B - 30 Jun 2005 15:46 GMT
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