472,146 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 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 1322
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by jalkadir | last post: by
5 posts views Thread by samik_tanik | last post: by
7 posts views Thread by jchludzinski | last post: by
7 posts views Thread by Matthew Wieder | last post: by
4 posts views Thread by hope | last post: by
3 posts views Thread by Saladin | last post: by
5 posts views Thread by Bilgehan.Balban | last post: by

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.