Groups | Blog | Home
all groups > asp.net datagrid control > december 2006 >

asp.net datagrid control : Format Date in BoundField


stefanjohansson_2005 NO[at]SPAM yahoo.se
12/8/2006 7:06:44 AM
I have the code below to display and format a date column in a
GridView. This works when the GridView is in read mode. But when I
select Edit the date is no longer formated with DataFormatString. What
should I do?

<asp:BoundField DataField="StartDate" HeaderText="StartDate"
SortExpression="StartDate" DataFormatString="{0:d}" HtmlEncode="False"
/>
stefanjohansson_2005 NO[at]SPAM yahoo.se
12/12/2006 4:56:03 AM
Found it! There is another setting called ApplyFormatInEditMode.

stefanjohansson_2005@yahoo.se skrev:

[quoted text, click to view]
AddThis Social Bookmark Button