I want to put dhe datas to textboxes from listview items when I select a row. It's all ok after the first selection occurs. But when I select again this error occurs: "*System.ArgumentOutOfRangeException*". Is there a way to reset the selecteditem...
I want to put dhe datas to textboxes from listview items when I select a row.
It's all ok after the first selection occurs. But when I select again this error occurs: "
System.ArgumentOutOfRangeException". Is there a way to reset the selecteditem to starting condition, after I select a row. Or maybe another solution, here's the code:
Code:
private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
this.txtID.Clear();
this.txtSurname.Clear();
this.txtName.Clear();
this.txtID.Text = Convert.ToString(this.listView1.SelectedItems[0].SubItems[0].Text);
this.txtSurname.Text = Convert.ToString(this.listView1.SelectedItems[0].SubItems[1].Text);
this.txtName.Text = Convert.ToString(this.listView1.SelectedItems[0].SubItems[2].Text);
}