c# - Multiply quantity with price and display total -


I have an edit button in Gridview when I click that two fields will change into textbox volume and total. User Total Amount is edited automatically and displays results in total area .. but I am getting the error in line

  decimal value = convert. ToDecimal (row.Cells [ 1]. Change the text ("$", string.opti). Change (",", string.app Mr.));   

The input string was not in a correct format here

  Secure zero txtQuantity_TextChanged (Object Sender, EventArgs E) {Text box txtQuantity = (TextBox) Sender; GridViewRow line = (GridViewRow) txtQuantity.NamingContainer; Text box txtTotal = (text box) line. Fontcontrol ("testtal"); Decimal Value = Convert. ToDecimal (row.Cells [1]. Change the text ("$", String.Empty). (",", String.Empty) Replace; decimal total = value * Convert. ToInt32 (txtQuantity. Text); TxtTotal.Text = string.Format ("{0: C}", total);}    

Try it instead:

  decimal value = decimal. merge (line call [1]. Change text (" $ "," "). Replace ( ",", ""));    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -