Whenever I enter a value in rate column I want to multiply that value with quantity column and display result in amount column immediately in c# -


i want enter value in datagridview rate column @ run time , multiply value quantity column value , display result in amount column immediately

public void calculategrid() {         foreach (datagridviewrow row in datagvlist.rows)         {             double qty = convert.todouble(row.cells["quantity"].value);             amt = (qty * (convert.todouble(row.cells["rate"].value)));             row.cells["amount"].value = amt.tostring();         } }  public void calamt() {         (int x = 0; x < datagvlist.rows.count; x++)         {             tot_amt += convert.todouble(datagvlist.rows[x].cells["amount"].value);         }         txtboxtotal.text = tot_amt.tostring(); } 

when execute code error

input string not in correct format.

i called method in datagvlist_cellvaluechanged() event.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -