In my datagridview, I have two Columns : Quantity and Price.
I want to change the quantity and then price will be updated.
I also want to set the price as a decimal format.
Currently this is the code I have written, But it is not working correctly. Right now what it does is if you type in the quantity as "5", it times it by the price, but if you were to set the quantity back to "1", the price doesn't update . It just keeps adding up and up.
I don't want to use a Binding source. I am happy with working with MySql Database
I want to change the quantity and then price will be updated.
I also want to set the price as a decimal format.
Currently this is the code I have written, But it is not working correctly. Right now what it does is if you type in the quantity as "5", it times it by the price, but if you were to set the quantity back to "1", the price doesn't update . It just keeps adding up and up.
I don't want to use a Binding source. I am happy with working with MySql Database
Code:
Dim i As Integer
i = Main.ItemGridView.CurrentRow.Index
MsgBox("You Are About To Change Quantity To: " & Val(TextBox1.Text))
Main.ItemGridView.Item("Qty", i).Value = TextBox1.Text
Main.ItemGridView.Item("Price", i).Value = Main.ItemGridView.Item("Qty", i).Value * Main.ItemGridView.Item("Price", i).Value