I've encountered a problem.
I've a class that looks like this:
Expand|Select|Wrap|Line Numbers
- public class student
- {
- public int number;
- public string surname;
- public string[] subjects = new string[10];
- };
Expand|Select|Wrap|Line Numbers
- List<student> students = new List<student>();
Expand|Select|Wrap|Line Numbers
- students.Add(new student
- {
- number = counter1,
- surname = textBox1.Text,
- subjects = choice
- });
Expand|Select|Wrap|Line Numbers
- choice[0] = listView1.Items[counter1].SubItems[1].Text;
- choice[1] = listView1.Items[counter1].SubItems[2].Text;
My problem is that, when I add two students, and let's say, I set English on Higher Level on the first one and on Standard Level on the second one, the choice of the first one is getting overwrited. As such, both take the value "Standard Level". Any ideas on how may I fix this? May I somehow lock the items inside the list to make them non-changeable upon addition?