473,480 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

setting tabs in a string

Hi,

I am filling a server side listbox in an asp.net app
Each text value for each item in the list is created by concatenating to
string values together.

I want to give the appearance of columns in the drop down list box.
i.e.
jan 2000
feb 2000
mar 2000

however I am getting :
jan 2000
feb 2000
mar 2000
in the list box.

any ideas how to format them so they are nice and cleanly creating columns?
P.S: adding a string with spaces in the middle does nothing.

item.text = string1 & " " & string2
this still only gives 1 space between the two.
thanks

Chris

Jul 21 '05 #1
3 1248

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
Hi,

I am filling a server side listbox in an asp.net app
Each text value for each item in the list is created by concatenating to
string values together.

I want to give the appearance of columns in the drop down list box.
i.e.
jan 2000
feb 2000
mar 2000

however I am getting :
jan 2000
feb 2000
mar 2000
in the list box.

any ideas how to format them so they are nice and cleanly creating
columns?
P.S: adding a string with spaces in the middle does nothing.

item.text = string1 & " " & string2
this still only gives 1 space between the two.
thanks

Chris


Unfortunately I don't know as though there is a way to do this. HTML only
allows one white space untless you use &nbsp; Unfortunately the List
Box will HTMLEncode the &nbsp; string and actually display that. If you can
use a visible character you can use like a "_" or something to seperate the
columns. Also remember that if the font you are using is not a fixed width
font no matter what character you use the columns will not line up
correctly.
Jul 21 '05 #2
Hi Chris,

I have a small workaround. In case you are binding the values to the drop
down from a SQL Query / Stored procedure, then you can use this. In SQL Query
use

Column A + ' ' + Column B as Column C

And now bind it to the list box.

In case this dosent help, do post a msg back and we shall see abt it.
Happy Coding

"Chris" wrote:
Hi,

I am filling a server side listbox in an asp.net app
Each text value for each item in the list is created by concatenating to
string values together.

I want to give the appearance of columns in the drop down list box.
i.e.
jan 2000
feb 2000
mar 2000

however I am getting :
jan 2000
feb 2000
mar 2000
in the list box.

any ideas how to format them so they are nice and cleanly creating columns?
P.S: adding a string with spaces in the middle does nothing.

item.text = string1 & " " & string2
this still only gives 1 space between the two.
thanks

Chris

Jul 21 '05 #3

Not sure how this works in .net but in ASP you can add a &nbsp which
will force a space.

optionString="jan &nbsp&nbsp&nbsp 2000"
would force 3 more spaces into the string.
not sure if theres a code for tab but im sure it would the same.
assuming this is valid in .net


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #4

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

Similar topics

7
1418
by: danny | last post by:
Hello everyone, How can I go about setting a number of variables using a table which will have the variable names to be declared in one table. The data to be assigned will reside in another. As...
4
7068
by: Tamir Khason | last post by:
How can I set the type of the object added to ArrayList (type of Array List Members) Here is the code: protected ArrayList tabs = new ArrayList(); public ArrayList Tabs {
0
5043
by: Matt | last post by:
This took way to long to figure out - now that I have it working I thought I would share with the group. I've seen tons of posts with very little good answers on this seemingly simple thing that...
2
1528
by: qwweeeit | last post by:
Hi all, from a string embedding tabs I want to colorize them when expanded: # Starting from a string: a= '1234\t5678\t\t90\nqwerty\nasdfg' # which embeds both tabs and lfs # printing it you...
135
7336
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
1
5356
by: socasteel21 via AccessMonster.com | last post by:
I have a spreadsheet that has 3 tabs each of the worksheets is setup exactly like a cooresponding table in Access. I created a button that should import each tab to a new table and then append...
11
6140
by: cmay | last post by:
I am having this problem... Lets say that your source XML is formatted like this: <somenode> Here is some text Here is some more text </somenode> When to a <xsl:value-of select="somenode" /I...
15
2878
by: Tom Plunket | last post by:
The documentation for dedent says, "Remove any whitespace than can be uniformly removed from the left of every line in `text`", yet I'm finding that it's also modifying the '\t' characters, which...
12
7516
by: ibloom | last post by:
I've been trying for a couple days to build a program using pyObjC on a mac, I'm stuck on this error: <string>: inconsistent use of tabs and spaces in indentation Traceback (most recent call...
2
2752
by: angi35 | last post by:
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs. Within each tab is a SubForm. Within each SubForm is a tab...
0
6911
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
7050
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
7091
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
6743
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2999
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
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
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 ...
0
185
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.