gridview.boundfield.dataformatstring doesn't work

  • Thread starter Abraham Andres Luna
  • Start date
A

Abraham Andres Luna

i tried the following code:

<asp:gridview id="gvRDK" runat="server" autogeneratecolumns="false">
<columns>
<asp:Boundfield DataField="DateCreate" DataFormatString="DateCreate:
{0:d}" HeaderText="Date Created:" />
</columns>
</asp:gridview>

but i got the following output:

Date Created:
DateCreate: 1/1/1900 12:00:00 AM


why isn't it formatting as a short date?

i then tried to following code:

<asp:datagrid id="dgRDK" runat="server" autogeneratecolumns="false">
<columns>
<asp:Boundcolumn DataField="DateCreate" DataFormatString="DateCreate:
{0:d}" HeaderText="BoundColumn" />
</columns>
</asp:datagrid>


and got the expected output:
BoundColumn
DateCreate: 1/1/1900


thank you for your help
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top