Hello! I have a little problem. I don't understand how to solve this issue:
Object reference not set to an instance of an object.
Thank you!
This is my code:
BindingList<ComboBox> cmbPlayers = new BindingList<ComboBox>();
Club[] league = new Club[10];
// league contains class Club
// class Club contains property Player[] (set as new Player[30])
// Players contains class Player
// Player has property String Name
private void cmbTacticsAddPlayers() {
foreach (var cmb in cmbPlayers)
{
for (int i = 0; i <= league[0].Players.Length;i++ )
{
cmb.Items.Add(league[0].Players[i].Name); // THROWS EXCEPTION
}
}
}