473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1246

"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
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.