Formatting Columns using Bind

Posted Tuesday, October 10, 2006 1:41 PM by C-Dog's .NET Tip of the Day

If you are using two-way data binding (whether it is a formview, gridview, etc), you may find a place where you need to format a column such as a date. Bind has a second parameter which accepts typical bind expressions.

For example, to format a date, do something like this:

<%# Bind("MyDateColumn", "{0:d}") %>

Special thanks to Bobby for the contribution.

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=311