"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:10******** *************** ***********@mic rosoft.com...
Howdy,
It did work for me. Any chance there is a default style for a table cell
defined?
Here is the datagrid statement:
<asp:DataGrid
Visible=true
AllowSorting="f alse"
AutoGenerateCol umns="false"
CellPadding="0"
CellSpacing="0"
ID="DataGrid1"
runat="server"
BorderWidth="0"
ShowFooter="fal se"
ShowHeader="tru e"
GridLines="None "
Width="245px" Style="border-collapse:collap se;padding-left:2px">
<columns>
<asp:TemplateCo lumn Visible="true" ItemStyle-HorizontalAlign ="center"
ItemStyle-Width="25px">
<itemtemplate >
<asp:CheckBox ID="Choice" OnCheckedChange d="Handle3rdPar tyPost_Click"
AutoPostBack="t rue" runat="server" />
</itemtemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="true" ItemStyle-Width="120px" HeaderText="3rd
Party" HeaderStyle-Font-Bold="true"
ItemStyle-VerticalAlign=" middle" >
<itemtemplate >
<asp:Label ID="JobBoardNam e" Text='<%# Container.DataI tem("Name")%>'
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="false" itemStyle-Width="80px"
ItemStyle-VerticalAlign=" middle" >
<itemtemplate >
<asp:Label ID="JobBoardPri ce" Text='<%# Container.DataI tem("Price")%>'
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="true" itemStyle-Width="100px"
HeaderText="Amo unt Per Job" HeaderStyle-Font-Bold="true"
ItemStyle-VerticalAlign=" middle" ItemStyle-HorizontalAlign ="right" >
<itemtemplate >
<asp:Label ID="JobBoardPri ceDisplay" style="text-align:right"
runat="server"/>
</itemtemplate>
<ItemStyle HorizontalAlign ="right"/>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="false" ItemStyle-Font-Bold="true"
ItemStyle-Width="165px" ItemStyle-VerticalAlign=" middle">
<itemtemplate >
<asp:TextBox ID="AccountNumb er" Text='<%#
Container.DataI tem("AccountNum ber")%>' Enabled="true" Columns="15"
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="false" >
<itemtemplate >
<asp:Label ID="JobBoardID " Text='<%# Container.DataI tem("JobBoardID ")%>'
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
<asp:TemplateCo lumn Visible="false" >
<itemtemplate >
<asp:TextBox ID="RecordState " Visible="false" Columns="10"
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
</columns>
</asp:DataGrid>
<asp:Label ID="ErrorMessag e2" ForeColor="red" runat="server"/>
The important cell would be the ID=JobBoardPric eDisplay.
Thanks,
Tom
>
Regards
--
Milosz
"tshad" wrote:
>"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:7F******* *************** ************@mi crosoft.com...
Hi there,
<Columns>
<asp:TemplateFi eld>
<ItemTemplate >
<asp:Label runat="server" ID="lbl"/>
</ItemTemplate>
<ItemStyle HorizontalAlign ="right"/>
</asp:TemplateFie ld>
</Columns>
That doesn't work either. It seems to be the same as what I have (except
mine is inside the asp:TemplateCol umn tag).
<asp:TemplateCo lumn Visible="true" itemStyle-Width="100px"
HeaderText="Am ount Per Job" HeaderStyle-Font-Bold="true"
ItemStyle-VerticalAlign=" middle"
ItemStyle-HorizontalAlign ="right"
> >
<itemtemplate >
<asp:Label ID="JobBoardPri ceDisplay" style="text-align:right"
runat="serve r"/>
</itemtemplate>
<ItemStyle HorizontalAlign ="right"/>
</asp:TemplateCol umn>
Here is the result in my view source:
<td align="Right" valign="Middle" style="width:10 0px;">
<span id="DataGrid1__ ctl4_JobBoardPr iceDisplay">$1. 00</span>
</td>
It creates the align="Right" in the td tag and seems to take out the
text-align:right completely as I assume that is because it is going to
create its own style from the ItemStyle... attributes.
But I assume that since there is nothing in the span statement - the
align
doesn't seem to work.
Thanks,
Tom
>
hope this helps
--
Milosz
"tshad" wrote:
I have a datagrid that I cannot get to right justify a money amount
(which
is just a label). No matter what I do - it still right justifies it.
<asp:TemplateC olumn Visible="true" itemStyle-Width="100px"
HeaderText="Am ount Per Job" HeaderStyle-Font-Bold="true"
ItemStyle-VerticalAlign=" middle" ItemStyle-HorizontalAlign ="right" >
<itemtemplate >
<asp:Label ID="JobBoardPri ceDisplay" style="text-align:right"
runat="serve r"/>
</itemtemplate>
</asp:TemplateCol umn>
I tried 2 different ways:
ItemStyle-HorizontalAlign ="right"
style="text-align:right"
This gives me the following results when I view source:
<td align="Right" valign="Middle" style="width:10 0px;">
<span id="DataGrid1__ ctl3_JobBoardPr iceDisplay"
style="text-align:right"><s trong>$25.00</strong></span>
</td>
What else can I do to make this work?
Thanks,
Tom