Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I have displayed amount in grid view which is coming like 2000.0000 but I need 2000.00
Please help me.
I have searched from net it is showing $2,000.00

Thanks.
Posted

hi,


You have to get that values in rowdatabound event by declaring the control as a variable and format it as you desired and again reassign that variable to the gridview

eg.
C#
DropDownList dlstNumberPageno = DropDownList)e.Row.FindControl("dlstNumberPageno");

int val=dlstNumberPageno.Value;


use string.format function and reassign value to control
 
Share this answer
 
v2
Comments
thatraja 16-Jan-12 5:38am    
5!
you can use dataformatstring parameter for this format

ASP.NET
<asp:boundfield datafield="columnname" dataformatstring="{0:#0.00}"   />
 
Share this answer
 
v2
Comments
thatraja 16-Jan-12 5:37am    
Right, 5!
Technoses 16-Jan-12 10:55am    
please approve this as your solution

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