Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
col1 col2 = col3
2 3 = 6

this is my code

Double quantity = Double.Parse(row.Cells["clmQuantity"].Value.ToString());
Double purrate = Double.Parse(row.Cells["clmPurRate"].Value.ToString());
Double amount = Math.Round(quantity * purrate, 2);
amount = Double.Parse(row.Cells["clmAmount"].Value.ToString());
Posted

1 solution

try this,
C#
foreach (DataGridViewRow row in dataGridView1.Rows)
           {
               row.Cells["clmAmount"].Value = (Double.Parse(row.Cells["clmQuantity"].Value.ToString()) * Double.Parse(row.Cells["clmPurRate"].Value.ToString())).ToString();
           }



Hope this helps
 
Share this answer
 

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