Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show date in GridView control
Message
From
07/07/2006 11:57:05
 
 
To
07/07/2006 11:33:06
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01134482
Message ID:
01134491
Views:
15
I have a ASP.Net webform with a GridView control. I display a dataset from a SQL Server table in this GridView. One of the columns is a DateTime field.

How can I make the DateTime column display just the date in the GridView control? Right now the full DateTime from the field displays in the column. How can I get rid of the time portion for display purposes in the GridView?


Hi, Jerry,

First, in the column definition, set the DataFormatString to {0:d}

Second, (if you're using ASP.NET 2.0), set the HTMLEncode property to false. (This is a new security feature in ASP.NET 2.0 to deal with cross-page postbacks).

Hope that helps...
Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform