• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

formatting gridView columns

How would I go about getting a column in a GridView to always show a dollar sign *all the way to the LEFT of the column*.  Right now the content of it is right justified, but I would like to put a dollar sign all the way to the left.  Thanks.
0
ARACK04
Asked:
ARACK04
1 Solution
 
Edwin_CCommented:
It can be done using a label control inside a template column.

<asp:TemplateField HeaderText = "Amount">
    <ItemStyle HorizontalAlign="right" />
       <ItemTemplate>
          $<asp:Label ID="lblAmt" runat="server" Width="100px" Text='<%# Eval("amt", "{0:N2}") %>'></asp:Label>
       </ItemTemplate>
</asp:TemplateField>

Hope that helps
Edwin
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now