Wrox Programmer Forums
|
BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5
This is the forum to discuss the Wrox book Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit by David Sussman, Alex Homer; ISBN: 9780764588075
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 9th, 2006, 07:49 PM
est est is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataFormatString not working properlyi

I am trying to apply a DataFormatString of {0:C} or $ {0:F2} to the ItemPrice of the GridView as recommended on page 116 of the book.
No matter what I do, I always get FOUR decimal places. Even Figure 4-13 on page 117 shows the final result page with four decimal places.

Any suggestions?

 
Old April 10th, 2006, 12:46 PM
est est is offline
Registered User
 
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it to work correctly following a hint on the MS VWD support site: for the column(s) where you specify a DataFormatString also set HtmlEncode=False

 
Old April 11th, 2006, 05:45 AM
Authorized User
 
Join Date: Jan 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, it does work fine in other controls such as Label, as used in the final code for the example shown on page 122.





Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Boundfield - DataFormatString snufse1 ASP.NET 2.0 Basics 0 September 23rd, 2008 05:56 PM
HTMLEncode and DataFormatString Exceptions wirerider ASP.NET 2.0 Basics 1 October 4th, 2006 07:53 PM
DataFormatString does not format bnorg ASP.NET 2.0 Professional 1 September 19th, 2006 12:34 PM
<asp:boundcolumn DataFormatString=......> bnorg ASP.NET 2.0 Basics 0 August 27th, 2006 12:18 PM
how to make lower case in dataformatstring hardik Classic ASP Databases 1 February 14th, 2006 05:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.