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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -