I am trying to create a program that will take orders from the user. My problem is that I cannot sort the foods alphabetically because I have 3 separate list boxes, 1st list box is for the name of the food, 2nd for the quantity of the food, and the 3rd list box is for the price of the food. What I want is for the 2nd and 3rd list box to follow the 1st list box so for example if list boxes contains Orange(2pcs)($1), Melon(3pcs)($2), Apple(1pc)($4)
How it looks like:
Orange | 2pcs | $1
Melon | 3pcs | $2
Apple | 1pcs | $4
Then after pressing the "Sort" button I want it to look like this:
Apple | 1pcs | $4
Melon | 3pcs | $2
Orange | 2pcs | $1
I do not know what to do with the 2nd and the 3rd list box after sorting the 1st list box. I do not know how to make the 2nd and the 3rd one follow the order of the 1st list box.
http://postimg.org/image/awxe4pk4t/ User will type in the food name and choose in the combo box the desired quantity. Then after pressing the add to cart button the program will add the input to the list boxes the price will appear on the 3rd list box according to the food that the user typed in. There are only 10 types of food declared in this program.