GridView and BoundField DataFormat Strings with Dates

Posted by: Rick Strahls WebLog, on 29 Oct 2006 | View original

More in the line of stupid pet tricks: I keep running into this particular issue from time to time and promptly forget the solution, so Im blogging it again for my own sanity.   If you use GridView and you have a BoundField column in you might run code like this to format a date string:   <asp:BoundField  DataField="OrderDate" DataFormatString="{0:d}" HeaderText="Date"                  meta:resourcekey="BoundField">    ...

Advertisement

News Categories

.NET | ADO.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Community Server | dasBlog | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD