To format columns in a GridView control, you can use the FormatString property:
//Formatting Currency <asp:GridView id="grid" Runat="Server" > <Columns> <asp:BoundField HeaderText="Amount" DataField="amt" FormatString="{0:c}"/> </Columns> </asp:GridView>
To format a Date column, you must also set the HTMLEncode property to “False”.
//Formatting a date column <asp:BoundField HeaderText="Amount" DataField="date1" FormatString="{0:d}" HTMLEncode="False" />
To format a Currency with no cents:
//No cents in the currency <asp:BoundField HeaderText="Amount" DataField="amt" FormatString="{0:$#,0}" />
May 3rd, 2010 at 7:08 am
Merci pour ce post intéressant. si vous continuer ainsi je vais devenir un lecteur fidéle