hi,
I want to show in grid view add dollar ($) in amount column , how to dataformat stirng use. I am not using databoundfield column . I am
using this code. Add dollar sign
currentbalance column
<asp:GridView ID="GridView1" GridLines="None" runat="server" OnRowCancelingEdit="GridView1_RowCancelingEdit"
AutoGenerateColumns="false" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing"
DataKeyNames="transid" OnRowDataBound="GridView1_RowDataBound" OnRowUpdating="GridView1_RowUpdating"
Height="362px" Style="margin-bottom: 39px" Width="705px">
<Columns>
<asp:TemplateField HeaderText="Id">
<ItemTemplate ><%
# Eval("transid") %></ItemTemplate>
<EditItemTemplate>
<asp:Label runat="server" ID="transid" Text='<%# Bind("transid") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DeptType">
<ItemTemplate><%
# Eval("depttype") %></ItemTemplate>
<EditItemTemplate><%
--<asp:TextBox runat="server" ID="Editdeptype" --%><asp:DropDownList runat="server" ID="Editdepttype" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="lendername">
<ItemTemplate><%
# Eval("lendername") %></ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" CssClass="txt" ID="Editlendername" Text='<%# Bind("lendername") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="currentbalance">
<ItemTemplate><%
# Eval("currentbalance") %></ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" CssClass="txt" ID="Editcurrentbalance" Text='<%# Bind("currentbalance") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="minimumbalance">
<ItemTemplate><%
# Eval("minimumpayment")%></ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" CssClass="txt" ID="Editminimumbalance" Text='<%# Bind("minimumpayment") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="actualpayment">
<ItemTemplate><%
# Eval("actualpayment") %></ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" CssClass="txt" ID="Editactualpayment" Text='<%# Bind("actualpayment") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="interstrate">
<ItemTemplate><%
# Eval("interstrate")%></ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" Width="52px" ID="Editinterstrate" Text='<%# Bind("interstrate") %>' /><%
<%
-- <asp:HiddenField ID="EditId" runat="server" Visible="false" />--%>--<asp:Label runat="server" ID="EditId" Text='<%# Bind("transid") %>' />--%></EditItemTemplate>
</asp:TemplateField>
<%
<asp:BoundField DataField="MinimumPayment" DataFormatString="{0:C}" HtmlEncode="false" />
<asp:BoundField DataField="ActualPayment" DataFormatString="{0:C}" HtmlEncode="false" />
<asp:BoundField DataField="InterstRate" DataFormatString="{0:C}" HtmlEncode="false" />--
-- <asp:BoundField DataField="currentbalance" DataFormatString="{0:C}" HtmlEncode="false" /> %><asp:CommandField ShowEditButton="true" />
<asp:CommandField ShowDeleteButton="true" />
</Columns>
</asp:GridView>