Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Format Date in BoundField

Reply
Thread Tools

Format Date in BoundField

 
 
stefanjohansson_2005@yahoo.se
Guest
Posts: n/a
 
      12-08-2006
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
 
 
 
 
stefanjohansson_2005@yahoo.se
Guest
Posts: n/a
 
      12-12-2006
Found it! There is another setting called ApplyFormatInEditMode.

http://www.velocityreviews.com/forums/(E-Mail Removed) skrev:

> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Format Strings for BoundField column Adam Right ASP .Net 2 02-12-2008 07:12 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments