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

Datagrid formatting dropping leading blanks

tfs
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 the end of the column and the 3rd column is too close and
confusing. So I was trying to move the data in the 3rd column over a
few spaces.

So I did the following:

SELECT tableName,startTime,executionTime = replicate(' ',6) +
convert(char(10),Round((executionTime /
60),2)),numRecordsCopied,numRecordsInError FROM VDW..xferstats

This works fine in the SQL Query in the table view and it does move
the data to the right a few places. When I run this in my web page
with the following datagrid, the text has all the leading spaces
truncated:

<asp:DataGrid AllowPaging="false"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
DataSource="<%# DataSet1.DefaultView %>" ID="DataGrid1"
runat="server"
ShowFooter="false"
ShowHeader="true"
> <HeaderStyle HorizontalAlign="center"

BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" /> <ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller"
/> <AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller"
/> <FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" /> <PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller"
/> <Columns>
<asp:BoundColumn DataField="tableName"
HeaderText="Table Name"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="startTime"
HeaderText="Start Time"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="executionTime"
HeaderText="Execution Time"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="numRecordsCopied" HeaderText="Processed"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="numRecordsInError" HeaderText="Errors"
ReadOnly="true"
Visible="True"/>
</Columns>
</asp:DataGrid>


If I change the replicate(' ',6) to replicate('0',6), it shows the
leading 0's fine.

How do I get this to work, if it is even possible?

Thanks,

Tom
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 18 '05 #1
1 1410
"tfs" <tf*@dslextreme-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
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 the end of the column and the 3rd column is too close and
confusing. So I was trying to move the data in the 3rd column over a
few spaces.


HTML ignores spaces. If you need to space things that way, you need to use
"&nbsp;" (non-breaking space) instead.

You can also try playing with the styles on the column. In particular, you
can set the width of the column.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2

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

Similar topics

6
by: jalkadir | last post by:
I am trying to find a way to remove the leading and tailing blanks from a string. What I have come up with is not doing the work as I expected; because if the value I pass to the function is "...
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...
4
by: Dave Brydon | last post by:
Access 2003 I have a combo box in my personnel table, which draws its data from a trade code table; the original field in the code table, is numeric, Long Integer, and formatted with 5 zero's . ...
7
by: jchludzinski | last post by:
I tryin' to print out a string with a variable number of blanks/spaces preceding the string. I know that if I use: fprintf( stdout, "%12s", string ); I get 12 blanks preceding 'string'. If I...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
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...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
3
by: Saladin | last post by:
Hi VB.NET, Desktop app I have an Access table with numeric fields filled mainly with 0 (zeros). When I bind with datagrid, I don't want the zeros to show (ie: I want blank cells). Now I've...
5
by: Bilgehan.Balban | last post by:
Hi, I use %#08x to print unsigned integers in hexadecimal format. According to C ref. man. Harbison & Steele, #08 stands for "pad the number with up to 8 zeroes to complete it to 8 digit...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.