HighTechTalks DotNet Forums  

Format Date in BoundField

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Format Date in BoundField in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
stefanjohansson_2005@yahoo.se
 
Posts: n/a

Default Format Date in BoundField - 12-08-2006 , 10:06 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"
/>


Reply With Quote
  #2  
Old   
stefanjohansson_2005@yahoo.se
 
Posts: n/a

Default Re: Format Date in BoundField - 12-12-2006 , 07:56 AM






Found it! There is another setting called ApplyFormatInEditMode.

stefanjohansson_2005 (AT) yahoo (DOT) se skrev:

Quote:
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"
/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.