VB.Net GridView DataFormatString in ASP.Net

DataFormatString property of ASP.Net GridView BoundField allows you to specify the format for number values and display them with different styles. You can display the number value as currency, number, decimal or hexadecimal formats. You can also specify the formats dynamically using VB.Net code.

List of Formats

1. {0:C} Currency format

2. {0:D} Decimal format

3. {0:E} Exponential format

4. {0:F} Fixed format

5. {0:G} General format

6. {0:N} Number format

7. {0:X} Hexadecimal format

 

Try the sample below to understand the output of each type of DataFormatString used to format the numeric values displayed inside the ASP.net GridView control:

 

List of Formats:

  • HIRE EzineASP.Net Developers