473,498 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listbox padding ---adding spaces

2 New Member
Hi there

I currently have a listbox that displays provinces,regions and suburbs.I want to pad the items logically with spaces,but the spaces are being igonred...
eg

Province1
Regions1
region2
Province2
Region3
Suburb1
Suburb2



my code is as follows--I tried to do the following that was suggested somewhere...but still it ignores the spaces....
System.IO.StringWriter writer= new System.IO.StringWriter();
ListItem li2 = new ListItem();
li2.Value = "1,"+regionArray[p, 2];
Server.HtmlDecode(" ", writer);
String DecodedString = writer.ToString();

practiceAreas.Items.Add(DecodedString);---practiceareas is my listbox

Does anybody have any ideas?

Thanks
Nov 9 '06 #1
1 2183
MaRkHaSBEEnMade
2 New Member
EDIT--I had to put the ----- in this post to illustrate---it was ignored here to!

Hi there

I currently have a listbox that displays provinces,regions and suburbs.I want to pad the items logically with spaces,but the spaces are being igonred...
eg

Province1
-----------Regions1
-----------region2
Province2
-----------Region3
------------------------Suburb1
------------------------Suburb2



my code is as follows--I tried to do the following that was suggested somewhere...but still it ignores the spaces....
System.IO.StringWriter writer= new System.IO.StringWriter();
ListItem li2 = new ListItem();
li2.Value = "1,"+regionArray[p, 2];
Server.HtmlDecode(" ", writer);
String DecodedString = writer.ToString();

practiceAreas.Items.Add(DecodedString);---practiceareas is my listbox

Does anybody have any ideas?

Thanks
Nov 9 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
17863
by: Rowland | last post by:
Hi, I've got a field that stores numeric values, representing a tracking number. I've also got a stored procedure that will extract this field and return it to a client. However, I would like to...
2
1667
by: Papajo | last post by:
Is there a script that would add a space in front of and behind any text adding to a form box, it coud be triggered by either an onClick or onBlur event handler. Any help s appreciated. Thanks Joe
8
22573
by: VM | last post by:
I'd like to add several spaces to a string variable. For example, if the value is "VM", I'd like to add 7 spaces so the new value is "VM ". Is that possible? Thanks.
6
2858
by: Manan | last post by:
hello All, I have a simple question..I'm creating a tempString that contains my values then i'm adding to a ListItemCollection (). In my tempString i'm adding a spaces between each values it...
13
8545
by: lossed | last post by:
Hi everyone, Please excuse me if this has been asked before or sounds a bit dim. This is a question asked on another forum but the solutions being offered are focussing on programming rather...
3
2053
by: IchBin | last post by:
I am trying to pad a number with spaces to the left. I can pad it with zeros as in this code: printf("<option value='%d'>%04s %s</option>n", $row->id, $row->NumberOfQuotes,...
1
1571
by: theflyingminstrel | last post by:
Does anyone know how I might add a function to this script that continually adds one space before and after the entire query (not in between every word though)? Example: If I type in the...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
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
7165
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
7205
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...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
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
3093
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
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
291
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.