Reputation: 2407
<asp:BoundField DataField="ProductPrice" HeaderText="Price" />
How can I display a dollor sign before each record in the above column for every row?
Upvotes: 0
Views: 3792
Reputation: 7882
Use TemplateField instead of BoundField, you can format it like anything you want
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
$<%# Eval("ProductPrice")%>
</ItemTemplate>
</asp:TemplateField>
Upvotes: 0
Reputation: 4854
You can format your data value as Currency by using DataFormatString
<asp:BoundField DataField="ProductPrice" HeaderText="Price" DataFormatString="{0:C}" />
if the culture is setted to a country who has a dollar currency, it will work fine.
Upvotes: 4