Pass the values from ListView control to text boxes in c#
<pre><code>private void deleteDisplayGamesButton_Click(object sender, EventArgs e)
{
    //Game game = new Game(homeTeamComboBox.Text, int.Parse(homeScoreUpDown.Value.ToString()), awayTeamComboBox.Text, int.Parse(awayScoreUpDown.Value.ToString()));

    deleteDisplayGamesListView.Items.Clear();
    deleteDisplayGamesListView.View = View.Details;

    foreach (Game currentgame in footballLeagueDatabase.games)
    {
        ListViewItem row = new ListViewItem();
        row.SubItems.Add(currentgame.HomeTeam.ToString());
        row.SubItems.Add(currentgame.HomeScore.ToString());
        row.SubItems.Add(currentgame.AwayTeam.ToString());
        row.SubItems.Add(currentgame.AwayScore.ToString());
        deleteDisplayGamesListView.Items.Add(row);
    }
}
</code></pre>

<p>I need to pass the values from above ListView control to following text boxes when I use the deleteDisplayGamesListView_SelectedIndexChanged method.</p>

<pre><code>private void deleteDisplayGamesListView_SelectedIndexChanged(object sender, EventArgs e)
{
    deleteModifyHomeTeamTxt.Text = "";
    deleteModifyHomeScoreUpDown.Text = "";
    deleteModifyAwayTeamTxt.Text = "";
    deleteModifyAwayScoreUpDown.Text = "";

    foreach (Game currentgame in footballLeagueDatabase.games);
    {
        ?-----------------------------
    }
}
</code></pre>

<p>Futhermore I need to clear the row after inserting to the textboxes,which i selected from the ListView Control. </p>

<p>If you know how to do this please let me know.</p>
