Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a decimal value on the GridView BoundField which comes from sql
server and it shows in sql server like :
2096.62
14899.01

But show in grid view as
2096.0000
14899.0000

I want to display that values like
2096.62
14899.01
How can i do that. Please help me.
Posted

1 solution

Hi you can try like this using DataFormatString property in BoundField

Hope this helps you..

CSS
<asp:BoundField DataField="datafield" HeaderText="header data"
     ReadOnly="True" SortExpression="datafield" DataFormatString="{0:F2}" />
 
Share this answer
 
Comments
Sumon562 17-Sep-13 7:39am    
Thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900