|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Gridview can't format a dateI have a gridview bound to a SQL Server table. One of my columns is bound to
a datetime field. I set the column's dataformatstring property to {0:yy-MM-dd} or {0:d} or {0:D} it doesn't matter. The dates are shown as 4/8/2006 12:00:00 AM. I want the date only but I can't supress the time. The Gridview.autogeneratecolumns = false if that matters. Any suggestion would be greatly appreciated. Thanks. Hi,
set HtmlEncode="False" to the BoundColumn Show quoteHide quote "Steve" <Steve@nospam.com> wrote in message news:uLBvgV0WGHA.4976@TK2MSFTNGP03.phx.gbl... >I have a gridview bound to a SQL Server table. One of my columns is bound >to a datetime field. I set the column's dataformatstring property to >{0:yy-MM-dd} or {0:d} or {0:D} it doesn't matter. The dates are shown as >4/8/2006 12:00:00 AM. I want the date only but I can't supress the time. >The Gridview.autogeneratecolumns = false if that matters. Any suggestion >would be greatly appreciated. > > Thanks. > > Works great. Thanks so much!
Show quoteHide quote "Teemu Keiski" <jot***@aspalliance.com> wrote in message news:uXmSDa0WGHA.4148@TK2MSFTNGP03.phx.gbl... > Hi, > > set HtmlEncode="False" to the BoundColumn > > -- > Teemu Keiski > ASP.NET MVP, AspInsider > Finland, EU > http://blogs.aspadvice.com/joteke > > "Steve" <Steve@nospam.com> wrote in message > news:uLBvgV0WGHA.4976@TK2MSFTNGP03.phx.gbl... >>I have a gridview bound to a SQL Server table. One of my columns is bound >>to a datetime field. I set the column's dataformatstring property to >>{0:yy-MM-dd} or {0:d} or {0:D} it doesn't matter. The dates are shown as >>4/8/2006 12:00:00 AM. I want the date only but I can't supress the time. >>The Gridview.autogeneratecolumns = false if that matters. Any suggestion >>would be greatly appreciated. >> >> Thanks. >> >> > >
DataMappingType in the DataSet Designer
UserControls and Collections Property I do I remove the style attribute from Image controls? HyperLinkField and FindControl Problem in designing layout of website UserControl Gridview Pager Modes Confirm delete in GridView - the easy way Eval in an OnClick? project or website location in design time |
|||||||||||||||||||||||