Hello,
I've encountered a problem.
I've a class that looks like this:
The objects of the class are then added to a list
while
etc.
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?
I've encountered a problem.
I've a class that looks like this:
Code:
public class student
{
public int number;
public string surname;
public string[] subjects = new string[10];
};
Code:
List<student> students = new List<student>();
Code:
students.Add(new student
{
number = counter1,
surname = textBox1.Text,
subjects = choice
});
Code:
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?
Comment