How do I link one listview to another to create a football league table?
Posted
by Richard Nixon
on Stack Overflow
See other posts from Stack Overflow
or by Richard Nixon
Published on 2010-04-22T12:23:44Z
Indexed on
2010/04/23
11:13 UTC
Read the original article
Hit count: 283
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
© Stack Overflow or respective owner