When I select one ListViewItem, the data populates correctly. But after selecting the second, it throws this exception. This exception would normally be thrown if I tried to set the selected item's properties, without have an item selected. But I check this in code. So I can't figure out what's going on.
EIDT: I fixed it by checking if the second list view had a selected item.Code:private void lvwAttributes_SelectedIndexChanged(object sender, EventArgs e) { if (this.lvwUserAttributesMapping.SelectedItems.Count > 0) { this.lvwUserAttributesMapping.SelectedItems[0].SubItems[1].Text = this.lvwAttributes.SelectedItems[0].Text; this.lvwUserAttributesMapping.SelectedItems[0].SubItems[2].Text = this.lvwAttributes.SelectedItems[0].SubItems[1].Text; } }




Reply With Quote