Hi Param,
Does my suggestion in the last reply help you resolve this problem? If
there're anything else we can help, please feel free to post here. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 150394533
| References: <uM**************@tk2msftngp13.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From:
st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Tue, 15 Nov 2005 08:20:17 GMT
| Subject: RE: gridview - data format
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <cM**************@TK2MSFTNGXA02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 50
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358160
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Param,
|
| Welcome.
| As for the "DataFormatString" not work for the GridView BoundField
problem,
| it is caused by the new "HtmlEncode" setting of the GridView BoundField.
By
| default the GridView BoundField's "HtmlEncode" attribute is turn on so
that
| the databound value on that boundfields will be htmlencoded before
rendered
| out(for security consideration...) And in that case the DataFormatString
| will not work. So in your scenario, you can just turn off the
"htmlencode"
| on that decimal databound field like:
|
| <asp:BoundField HtmlEncode="false" DataField="UnitPrice"
| DataFormatString="{0:C}" HeaderText="UnitPrice"
SortExpression="UnitPrice"
| />
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure!
www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
|
|
| --------------------
| | From: <pa***@community.nospam>
| | Subject: gridview - data format
| | Date: Mon, 14 Nov 2005 15:09:33 -0600
| | Lines: 13
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| | Message-ID: <uM**************@tk2msftngp13.phx.gbl>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: corp.lazardgroup.com 64.237.78.178
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:358065
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Hi all,
| |
| | I have a gridview control with a bound field as outlined below. The
| problem
| | is that the formatting is not happening. The data gets rendered as
| | 12999.0000. It is being stored in a decimal data type. Any ideas?
| |
| | <asp:boundfield headertext="Amount" datafield="amount"
| | dataformatstring="{0:C}"/>
| | TIA!
| |
| |
| |
| |
| |
|
|