Hi Victor,
Thank you for your post.
First, both "{0:C}" "{0:c}" will do the same since it's not case-sensitive.
The problem you encountered is described in a KB that is not published yet.
Here's some content of it:
KB919282
The value of a BoundField control is not formatted correctly when you set
the value of the DataFormatString member of the BoundField control in an
ASP.NET-connected Web application
SYMPTOMS
When you set the value of the DataFormatString member of a BoundField
control in an ASP.NET-connected Web application, the value of the
BoundField control is not formatted correctly. This problem occurs when the
following conditions are true:
* You are working with an ASP.NET-connencted Web application that is built
on the Microsoft .NET Framework 2.0.
* The application contains a DetailsView control or a GridView control
that in turn contains a BoundField control.
* The value of the HtmlEncode member of the BoundField control is set to
True in order to encode the value of the DataField member of the BoundField
control.
Note By default, the HtmlEncode member of a BoundField control is set to
True .
CAUSE
This problem occurs because the value in the DataField member of the
BoundField control is encoded before formatting is applied. When the value
of the DataField member is encoded, the data type of the value is changed
to String . Because the data type of the value of the DataField member is
changed, the value of the DataField member is not formatted correctly. For
example, if the value of the HtmlEncode member of the BoundField control is
set to True , the value of the BoundField control will be the same as the
result of the following pseudo-code:
String.Format( DataFormatString , HttpUtility.HtmlEncode( DataField ))
However, if the value of the HtmlEncode member of the BoundField control is
set to False , the value of the BoundField control will be the same as the
result of the following pseudo-code:
String.Format( DataFormatString , DataField )
RESOLUTION
To resolve this problem, set the value of the HtmlEncode member of the
BoundField control to False .
STATUS
This behavior is by design.
MORE INFORMATION
For more information about how to use the BoundField control, visit the
following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/sys...ndfield_member
s.aspx
For more information about how to use the HtmlEncode member of the
BoundField control, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/sys...ndfield.htmlen
code.aspx
Regards,
Walter Wang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.