GridView DataFormatString not formatting

A

AcaBrian

Formatting of column values was working fine with Beta 2 but is not working
with the final release. What changed? eg. {0:c} or {0:d} not working
 
L

leemeyers

For anyone else looking for the answer to this, set the value of the
HtmlEncode attribute of the BoundField control to false, as in:

<asp:BoundField DataField="StartDate" DataFormatString="{0:MM/dd/yyyy}"
HtmlEncode="false"/>

Apparently the value is HTML-encoded before the DataFormatString is
applied, which means the format string won't work.

Lee
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top