Scenario - In form A, user select sample/s and quantity and add it cart button. When you click on the add to cart button, it goes to form B where one could see the selection and then if they want to add more sample, they click go back.
Now I am not sure how to save user selection, because if I go back, it removes all data. I am newbee to this.
Please advise. My code -
form A
Form2 screen = new Form2(sample_array, quantity_array);
screen.ShowDialog();
form B
void populate_listview(string[] sample_name, string[] qty_amt)
{
for (int i = 0; i < lib_name.Length; i++)
{
string[] subitems = new string[] { sample_name[i], qty_amt[i] };
ListViewItem item = new ListViewItem(subitems);
listView1.Items.Add(item);
}
}
What code should I add so that it saves the current list and then append to new user selection.