Getting both Value and Display text from combobox - InfoPath Dev
in

InfoPath Dev

Getting both Value and Display text from combobox

Last post 04-24-2007 12:27 PM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-23-2007 05:54 AM

    Getting both Value and Display text from combobox

    Hello Everyone,

    Just wondering if there is an easy way of doing the following. I have a combobox and it displays text but the underlying value is an ID value, now i also have a button beside the combox (the combox is in a master detail repeating table) and when i click on that button i want to get the value AND the display text that is showing from the combox. Right now all i can get is the value from the event args of the button click but nothing shows the value. Is there a simple way of getting to this? I am thinking if there isn't i need to do a lookup from the database based on the value of the combobox.

    Thanks,

    Erin

  • 04-23-2007 09:48 AM In reply to

    Re: Getting both Value and Display text from combobox

    If you have manually populated your drop-down list, then you probably can't do this (at least not in any useful and easy manner). If you are populating the drop-down list from a secondary data source, then you just grab the stored value (the ID), and you look up the display value in the secondary data source using the ID value you have.

    Something like:

    var disp = XDocument.GetDOM("2DS").selectSingleNode("/Root/Table/Row[@id = " + ID + "]/@display");

  • 04-23-2007 10:43 AM In reply to

    Re: Getting both Value and Display text from combobox

    OHHHH. i Never even thought of that. I'll give that a try.

    Thanks,

    Erin 

  • 04-24-2007 12:27 PM In reply to

    Re: Getting both Value and Display text from combobox

    Great! Glad to have helped.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.