private void buttonAddCommander_Click(object sender, EventArgs e) { EDCommander cmdr = EDDConfig.GetNewCommander(); //List<EDCommander> dlist = (List < EDCommander > )dataGridViewCommanders.DataSource; //dlist.Add(cmdr); //dataGridViewCommanders.DataSource = dlist; //dataGridViewCommanders.Invalidate(); //dataGridViewCommanders.Update(); EDDConfig.listCommanders.Add(cmdr); dataGridViewCommanders.DataSource = null; dataGridViewCommanders.DataSource = EDDConfig.listCommanders; dataGridViewCommanders.Update(); //string[] row = new string[] { cmdr.Nr.ToString(), cmdr.Name, cmdr.APIKey, cmdr.NetLogPath }; //dataGridViewCommanders.Rows.Add(row); }