c# - DataFormatValue issue in GridView -
how can format currency value of column in gridview ?
i tryied following code, doesn't work, still unformatted.
<asp:gridview id="grddetalhepropostaexpirada" width="100%" runat="server" autogeneratecolumns="false" datasourceid="dsgridexpira"> <columns> <asp:boundfield headertext="valor" datafield="valorproposta" dataformatstring="{0:c}" /> </columns> </asp:gridview>
you have set htmlencode false:
<columns> <asp:boundfield headertext="valor" datafield="valorproposta" htmlencode="false" dataformatstring="{0:c}" /> </columns>
msdn: in versions of asp.net earlier 3.5, must set htmlencode property false in order format fields not string data types. otherwise, field value converted string default conversion method before format string stored in dataformatstring property applied.
Comments
Post a Comment