How do I link one listview to another to create a football league table?
- by Richard Nixon
Hi
I am creating a football system in windows forms c#. I have one listview where data is entered. I have 4 columns, 2 with team names linked to combo boxes and 2 with the scores linked to numericupdown controls. There are 3 buttons to add the results, Remove and clear. the code is below:
private void addButton_Click(object sender, EventArgs e)
{
{
ListViewItem item = new ListViewItem(comboBox1.SelectedItem.ToString());
item.SubItems.Add(numericUpDown1.Value.ToString());
item.SubItems.Add(numericUpDown2.Value.ToString());
item.SubItems.Add(comboBox2.SelectedItem.ToString());
listView1.Items.Add(item);
}
}
private void clearButton_Click(object sender, EventArgs e)
{
listView1.Items.Clear();
}
private void removeButton_Click(object sender, EventArgs e)
{
foreach (ListViewItem itemSelected in listView1.SelectedItems)
{
listView1.Items.Remove(itemSelected);
}
}
I have another listview that i want to link the first one to. The second one is a usual english football league table and i want to use maths to add up the games played and the points etc. please help.
cheers