473,513 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Dec 2 '05 #1
4 1697
Should work but end it with ;
 
"Ryan" <ry************@kp.org> schreef in bericht
news:11**********************@g49g2000cwa.googlegr oups.com...
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

Dec 2 '05 #2
I tried this, but it outputs a space and then &nbsp. For example:

Fish &nbsp; &nbsp; &nbsp; &nbsp | Swim &nbsp; &nbsp; &nbsp; &nbsp
| Ocean

I am not even sure why it rendering the space between &nbsp;

Any advice?

Dec 2 '05 #3
I see it, i did not found a solution, and i did try.
Filling through <%= "jkjklkj" %> was not allowed!

"Ryan" <ry************@kp.org> schreef in bericht
news:11*********************@o13g2000cwo.googlegro ups.com...
I tried this, but it outputs a space and then &nbsp. For example:

Fish &nbsp; &nbsp; &nbsp; &nbsp | Swim &nbsp; &nbsp; &nbsp; &nbsp
| Ocean

I am not even sure why it rendering the space between &nbsp;

Any advice?

Dec 5 '05 #4

"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43**********************@text.nova.planet.nl. ..
I see it, i did not found a solution, and i did try.
Filling through <%= "jkjklkj" %> was not allowed!

"Ryan" <ry************@kp.org> schreef in bericht
news:11*********************@o13g2000cwo.googlegro ups.com...
I tried this, but it outputs a space and then &nbsp. For example:

Fish &nbsp; &nbsp; &nbsp; &nbsp | Swim &nbsp; &nbsp; &nbsp; &nbsp
| Ocean

I am not even sure why it rendering the space between &nbsp;

Any advice?


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
Mar 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2377
by: Eric Sabine | last post by:
I am filling a drop down list from a dataset. The resultset contains data like this Joe Smith Accounting Mike Collins Engineering Joe Walter Engineering etc. The...
2
2956
by: George | last post by:
VS.NET 2002/VB Is there any way to right justify the items in a drop-down list? I have a list of fractions -- in 1/8 and 1/16 -- and they look kind of funky being left justified, especially...
13
5212
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
5
4204
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
4
2118
by: Rudy | last post by:
Hello! I have 4 diffrent drop downlist. I want a user to select a value from a drop down list, and place it in a SELECT statement. How would I put that value in the select statement. And if the...
3
3184
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
1
1311
by: rewf | last post by:
Hi, I fave this problem with a drop down list: I have a drop down list that work with a database. In the database I have some word with some spaces before like that "Example Example" My problem...
8
7561
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
4
9274
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
0
7166
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.