So I'm creating a project, which is a Point of Sale, like those in fast food chains.
The buttons on my POS is created dynamically, depends on the values from my database, and now I'm having a hard time to compute the subtotal when I change the quantity of each item. I used DataGrid to list all the products ordered by the customer.
I created two buttons which is add and minus that can set the quantity of the selected row in the datagridview, I'm not sure if I got it right but the code is also provided below which computes the price of the selected item multiplied to the quantity.
add
minus
My problem is, how can I compute the subtotal price, and the total quantity of items in my datagridview everytime I add items in my datagrid or I add or subtract in the quantity of the item.? The subtotal should reflect immediately EVERYTIME I add an item, or add or subtract an item.
Provided is a sample image to understand better what I want to happen in my project.