c# - How to fix date format in ASP .NET BoundField (DataFormatString)? -
i have dynamic boundfield (for detailsview) following code:
boundfield bf1 = new boundfield(); bf1.datafield = "createdate"; bf1.dataformatstring = "{0:dd/mm/yyyy}"; bf1.htmlencode = false; bf1.headertext = "sample header 2"; dv.fields.add(bf1); but somehow, still shows wrong format: 2013-04-29t18:15:20.270.
any way fix show "29/04/2013" instead? help.
you add dataformatstring="{0:m-dd-yyyy}" attribute bound field, this:
<asp:boundfield datafield="date" headertext="date" dataformatstring="{0:dd-m-yyyy}" />
Comments
Post a Comment