Drop down list in ASPX, how do I keep all my spaces

R

Ryan

I am databinding the dropdown list of a textbox in ASP.net. I am
trying to get three columns to display to the user. Since I can't do
that normally, I made my query display the three columns like so:

COLUMN1 + padding spaces to = 12 total characters | + ' ' COLUMN1 +
enough padding spaces to = 12 total characters | ' ' + COLUMN3

I then choose a fixed width font and everything should look like it
does in this nice example:

Fish0 0 | Swim 0 | Ocean
Fish00 | Swim 0 | Oceans2

In other words: pretty and lined up.

Unfortunately, it seems that the text box control likes to remove
spaces it does not deem necessary. An my nice columns go all screwy,
despite my fixed width font.

I know that there are probably controls out there that I could use to
do what I want, but is it possible to do this with the existing default
listbox control? Is there, for example, a character that will display
as a space that is not a space, thereby getting the textcontrol or IE
to keep it?

By the way, I tried outputting &nbsp in the query instead of spaces but
the text box rendered them as the string &nbsp not as spaces...

Thanks,
Ryan
 
R

Ryan

I tried this, but it outputs a space and then &nbsp. For example:

Fish       &nbsp | Swim       &nbsp
| Ocean

I am not even sure why it rendering the space between  

Any advice?
 
E

Edwin Knoppert

I see it, i did not found a solution, and i did try.
Filling through <%= "jkjklkj" %> was not allowed!
 
F

Fred Exley

Edwin Knoppert said:
I see it, i did not found a solution, and i did try.
Filling through <%= "jkjklkj" %> was not allowed!

I've been trying a similar idea all morning, with no luck. All I want is a
list of numbers on a web page that are aligned by decimal, for example:

" 35.3 "
" .1243 "
" 12 "
etc...

I can format datagrid columns as left/center/right justified, but it looks
kinda ugly when displaying a mixture of integers and decimals, as in the
above. I even tried having a separate label for each character, but they
collapse too. Has anybody got a way to display 'hard' spaces?
Thanks -Fred
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top