Thursday, September 10, 2009

Convert Numbers with 2 decimal places in GridView Field

If you are using template field in GridView
use
Text='<%# Bind("Project_cost", "{0:N}") %>'
in itemTemplate of that field
it will automatically convert your number field with 2 decimal places

If you are using boundField and wants to doing same
use
DataFormatString="{0:N}"

in that boundField it will automatically convert your number field with 2 decimal places

Keep visiting for more Information
sites.google.com/site/santo01org/

Best of luck

No comments:

Post a Comment