Reputation: 4763
Is there a way to make the binding work with string format?
<asp:TemplateField HeaderText="Price" >
<EditItemTemplate>
<asp:TextBox ID="txtPrice" runat="server" Text='<%# String.Foramt("{0:#,###}",Bind("Price")) %>' />
</EditItemTemplate>
Upvotes: 4
Views: 12682
Reputation: 148110
You can use overload form of DataBinder.Eval
<%# Eval("Price", "{0:#,###}") %>
Using Bind
<%= Bind("price", "{0:#,###}") %>
Upvotes: 2
Reputation: 1038710
You could use the following overload which allows you to specify the format:
<%# Bind("Price", "{0:#,###}") %>
Upvotes: 8