Drop Down List Trimming Spaces - InfoPath Dev
in

InfoPath Dev

Drop Down List Trimming Spaces

Last post 02-09-2011 04:50 PM by dlcj21. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-28-2011 11:25 AM

    Drop Down List Trimming Spaces

    Hi, I have a field that concatenates 3 values together separated by a |. I'm using a drop down list to display the concatenated field. Those 3 values are all variable length so I wrote a SQL query that pads in spaces to make it so that they are all the same length and use a fixed length font so that the | line up. It works in SQL and returns the expected result, but when the drop down is populated, it looks to be trimming off all of the spaces I've added. Is there a setting I can change or a work around I can do other than adding in underscores?
  • 01-31-2011 01:26 PM In reply to

    Re: Drop Down List Trimming Spaces

    I'm not seeing this behavior in either InfoPath 2010 or 2007--at least not if I manually add options to a drop-down list. The extra spaces I type in are shown when I preview the form and open the drop-down.

    Perhaps the changes are occuring when pulling down the data from SQL?

  • 01-31-2011 05:32 PM In reply to

    Re: Drop Down List Trimming Spaces

    Could you try padding the values with char(160) instead of ordinary spaces?  I think you might be encountering the behavior described here:

    http://en.wikipedia.org/wiki/Non-breaking_space#Use_as_non-collapsing_white-space

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-09-2011 04:50 PM In reply to

    Re: Drop Down List Trimming Spaces

    Thanks Jimmy, that did the trick.  Just in case others are having the same issue, you can type a non breaking white space by holding down alt, typing 0160 on your number pad, then release alt. It will insert a non breaking white space.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.