472,780 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

Listbox padding ---adding spaces

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 2130
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
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
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
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
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
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
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
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
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.