Use an XPath expression that contains a filter on the value that was selected
from the drop-down list box and use this to retrieve the corresponding text
by doing a lookup in the secondary data source that the drop-down is bound
to. So:
1. Retrieve the secondary data source that the drop-down is bound to in code.
2. Use SelectSingleNode and an XPath expression to find the one record that
contains the selected value; use an XPath filter for this.
3. Modify the XPath expression to include the node that corresponds to the
text of the selected value, and retrieve its value.
I know it's cryptic, so if you still do not understand how to do it, let me
know and I'll schedule publishing a walkthrough on my website this coming
weekend.
---
S.Y.M. Wong-A-Ton
> Hi,
> I have an infopath form where I use a webservice to populate a dropdown
[quoted text clipped - 8 lines]
> With Best Regards,
> Jayram.
rjayram - 17 Oct 2007 03:15 GMT
Hi Wong,
Thank you for this excellent and informative(atleast to me and
hopefully to others as well) reply. I was able to use your pointers and get
what I wanted. Thank you very much. But I will still request you to go ahead
and post a walk through on your site. I am sure I will get pointers to better
my code.
Thank you,
Jayram.
> Use an XPath expression that contains a filter on the value that was selected
> from the drop-down list box and use this to retrieve the corresponding text
[quoted text clipped - 24 lines]
> > With Best Regards,
> > Jayram.
S.Y.M. Wong-A-Ton - 17 Oct 2007 07:18 GMT
No worries. And well done! Since you did solve it yourself, I won't give the
walkthrough a high priority, so may eventually write and publish it, but
perhaps not this weekend.
---
S.Y.M. Wong-A-Ton
> Hi Wong,
>
[quoted text clipped - 35 lines]
> > > With Best Regards,
> > > Jayram.
mzam - 01 Nov 2007 20:55 GMT
Hi Guys,
I need to do the same thing except that I have to do it all in the form, no
code involved.
I actually need to find out the display value of a drop down and use it as
File Name when submitting the form to a document library. So far I get the
value but not the display value. How do I do this without writing any C# code?
Regards,
Mario
> No worries. And well done! Since you did solve it yourself, I won't give the
> walkthrough a high priority, so may eventually write and publish it, but
[quoted text clipped - 41 lines]
> > > > With Best Regards,
> > > > Jayram.