DataFormatString="${0:C2}"

D

David Lozzi

Howdy,

In my GridView i have some bound columns displaying currency. I have
DataFormatString="${0:C2}" in one of the columns but the value being
displayed is $35 . If the price has cents, then it will display the cents,
like $35.3 or $35.55, but where there's no cents, it just displays $35.
Shouldn't this override any datatypes from the datasource. Just to cofirm I
am sending a valid datatype, I checked everything out and this gridview is
being loaded from a arraylist of a class. The class has the following
property, which is even formatted there but it doens't matter...

Public ReadOnly Property Price() As Double

Get

Return FormatNumber(_price, 2)

End Get

End Property

Thanks!!
 
G

Guest

For some reason i have yet to understand you have to set the HTMLEncode
property to false or the DataFormatString is basically ignored.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top