title: Display the selected row from listview to textBox?
body: <p>How to display the selected row from listview to textBox?   </p>
  
  <p>This is how I do int dataGridView: </p>
  
  <pre><code>private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
  {
      dataGridView1.Rows[e.RowIndex].ReadOnly = true;
      if (dataGridView1.SelectedRows.Count != 0)
      {
          DataGridViewRow row = this.dataGridView1.SelectedRows[0];
          EmpIDtextBox.Text = row.Cells["EmpID"].Value.ToString();
          EmpNametextBox.Text = row.Cells["EmpName"].Value.ToString();
      }
  }
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>private void listView1_SelectedIndexChanged(object sender, EventArgs e)
  {
      ListViewItem item = listView1.SelectedItems[0];
      if (item != null)
      {
          EmpIDtextBox.Text = item.SubItems[0].Text;
          EmpNametextBox.Text = item.SubItems[1].Text;
      }
  }
  </code></pre>