Try this.
<asp:TemplateColumn SortExpression="UnitPrice" HeaderText="UnitPrice">
<ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.UnitPrice") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.UnitPrice") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
This worked for me.

Signature
Thanks
Kiran Kumar Pinjala
> I can't seem to get my cells in my Datagrid to right justify for my money
> fields.
[quoted text clipped - 12 lines]
>
> Tom
tshad - 27 Oct 2005 09:28 GMT
> Try this.
I did and it didn't work. But I found out why.
I have a statement in my styles sheet that has the following:
td {
empty-cells: show;
text-align:left;
}
I don't remember why I did this - I assume it was because of a problem I was
having with one of my tables.
But why wouldn't the Grid property override this?
The resulting code that the grid turns into is:
<td nowrap="nowrap" align="Right" style="width:90px;">
<span id="JobPostingGrid__ctl3_Balance">0</span>
</td>
So why didn't the align="Right" override the text-align:left?
Thanks,
Tom
> <asp:TemplateColumn SortExpression="UnitPrice" HeaderText="UnitPrice">
> <ItemStyle Wrap="False" HorizontalAlign="Right"></ItemStyle>
[quoted text clipped - 28 lines]
> >
> > Tom