473,383 Members | 1,742 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,383 software developers and data experts.

datagrid and leading spaces in fields

SKG
i have leading spaces in my database fields. When they appear in the
datagrid in browser,
they seem to be truncated. I did view source in browser and found that there
are indeed spaces but when browser
displays it crunches them in datagrid. Also i have update and delete
buttons options in this datagrid.
How can i display the leading spaces.?
TIA
Nov 18 '05 #1
3 1428
TIA,

Spaces in browsers are always truncated. Do a replace of the spaces with
  (code for non-breaking space).

MyString.Replace(" ", " ")

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"SKG" <su***********@yahoo.com> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
i have leading spaces in my database fields. When they appear in the
datagrid in browser,
they seem to be truncated. I did view source in browser and found that there are indeed spaces but when browser
displays it crunches them in datagrid. Also i have update and delete
buttons options in this datagrid.
How can i display the leading spaces.?
TIA

Nov 18 '05 #2
You'll have to replace the spaces with &nbsp; in the html, you should be able to pull this off in the itemdatabound event.

text = text.Replace(" ", "&nbsp;")

--Michael

"SKG" <su***********@yahoo.com> wrote in message news:um**************@TK2MSFTNGP09.phx.gbl...
i have leading spaces in my database fields. When they appear in the
datagrid in browser,
they seem to be truncated. I did view source in browser and found that there
are indeed spaces but when browser
displays it crunches them in datagrid. Also i have update and delete
buttons options in this datagrid.
How can i display the leading spaces.?
TIA

Nov 18 '05 #3
SKG
Thanks All!!
"Raterus" <ra*****@spam.org> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
You'll have to replace the spaces with &nbsp; in the html, you should be
able to pull this off in the itemdatabound event.

text = text.Replace(" ", "&nbsp;")

--Michael

"SKG" <su***********@yahoo.com> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
i have leading spaces in my database fields. When they appear in the
datagrid in browser,
they seem to be truncated. I did view source in browser and found that there are indeed spaces but when browser
displays it crunches them in datagrid. Also i have update and delete
buttons options in this datagrid.
How can i display the leading spaces.?
TIA

Nov 18 '05 #4

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

Similar topics

12
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered...
0
by: Ellen K. | last post by:
In a previous post I mentioned having a problem getting leading spaces to be written to SQL Server using OPENXML. They showed up fine in my XML documents if I printed them, but not in my database....
5
by: samik_tanik | last post by:
I need to export a datagrid to Excel. I could did this. But, also need to keep the leading zeros in the data. How can I acheive this? Any help would be appreciated. -- Thanking you in...
1
by: tfs | last post by:
I am reading into a datagrid and can't seem to get the "execution time" column (the 3rd column) to move to the right. My problem is that the last character in the 2nd column is right up against...
1
by: NancyA | last post by:
I am using the following code to write data from a datagrid to an Excel file: Dim tw As New System.IO.StringWriter Dim hw As New System.Web.UI.HtmlTextWriter(tw) dg.RenderControl(hw)...
5
by: HS1 | last post by:
Hello I have a datagrid to show data for a database table using "seclect * from tablename" The datagrid works OK. However, I want to change the name of the fields in the database to other...
4
by: John Nagle | last post by:
One can argue over tab vs. space indentation, but mixing the two is just wrong. Why not have CPython report an error if a file has both leading tabs and leading spaces? I know that was proposed...
5
by: Rowan | last post by:
Hi, I am somewhat new to .net and c#. (What I learned in previous co has to be unlearned). I am doing something that seems simple but I think there is a better way than how I learned to do it. ...
0
by: markpringle | last post by:
I am using a very simple multiline textbox (below) to capture text (poems). Many poems require formatting of the first line by including leading spaces. However, on submit, the leading spaces are...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.