Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Seperate large numbers with comma in asp.net gridview


     I Want to Seperate my Number using Seperate comma(Outstanding Colum). 

       if (Session["dt1"] != null) dt1 = (DataTable)Session["dt1"];
       DataRow dr = dt1.NewRow();
       dr["CusCode"] =txtCusCode.Text;//1
       dr["CusName"] = CustomerName;//2
       dr["NoofINV"] = CDET.Rows[i][1].ToString();//3
       dr["Outstanding"] = CDET.Rows[i][5].ToString();//4


       dt1.Rows.Add(dr);
       DebtorsGridView.DataSource = dt1;
       DebtorsGridView.DataBind(); 


How to do it??

I try  Flowing One it's not working

      dr["Outstanding"] = CDET.Rows[i][5].ToString("##,0.00");//4



Thank You
Posted

1. You can set formatting string while creating columns (in markup or code) using DataFormatString property of the bounded column. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring(v=vs.110).aspx[^]
2. For direct formatting with ToString use N... http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx[^]
 
Share this answer
 
Try this


C#
dr["Outstanding"] == Convert.ToDouble(CDET.Rows[i][5]).ToString("##,0.00");
 
Share this answer
 
Comments
[no name] 10-Feb-14 4:22am    
I try Not working

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