I have 2 forms, form1 and edit_form, and when the user selects an item in form1 to edit it, he is redirected to edit_form where he can make his changes and click apply. this is my code:
Form1 fs = new Form1();
fs.update_list(serial_edit_txt.Text, Items_edit_box.SelectedItem.ToString(), quantity_edit_box.Text, units_edit_txt.Text, unit_edit_rate_txt.Text);
this code is from edit_form, im calling form1 and calling a method with the edited values
public void update_list(string serial_edited, string item_box_edited, string quantity_edited, string units_edited, string units_rate_edited)
{
if (listView1.SelectedItems.Count > 0)
{
listView1.SelectedItems[0].SubItems[0].Text = serial_edited;
listView1.SelectedItems[0].SubItems[1].Text = item_box_edited;
listView1.SelectedItems[0].SubItems[2].Text = quantity_edited;
listView1.SelectedItems[0].SubItems[3].Text = units_edited;
listView1.SelectedItems[0].SubItems[4].Text = units_rate_edited;
}
else
{
}
}
this is code from form1. the problem im facing is that the items arent being change, i suppose this is because there is no item selected, and im not sure how to go about changing the existing item's values