Formatting columns in a GridView
Formatting columns in a GridView is relatively straightforward, once you know the appropriate format string.
Here are the steps if you are using Expression Web, Visual Studio, or Visual Web Developer:
- Open the Task Pane of your GridView and select Edit Columns
- In the Selected Fields Box, select the column you want to edit
- Find the HTMLEncode property and set it to false.
- Find the DataFormatString property and set it to the appropriate formatstring. The standard format of a format string is {0:format string}
Some examples of format strings are:
{0:c} to format as currency
{0:M-dd-yyyy} to format as a date
For more formatting strings, go to Formatting Types on MSDN.
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Formatting columns in a GridView…
This post has moved to http://castnerit.com/blog/?p=64...