//Helpers private void ReallocateScript(int lengthOfPeople) { for (int i = 0; i < ScriptEntries.Count; i++) { ScriptEntry row = ScriptEntries[i]; ScriptEntries[i].User = i % lengthOfPeople; } }
private void UpdateScriptTable(string[] names) { //Clear all rows dataGridViewScript.Rows.Clear(); //Iterate through list of entries, adding them to the table for (int i = 0; i < ScriptEntries.Count; i++) { ScriptEntry row = ScriptEntries[i]; string user = names[i % names.Length].ToString(); dataGridViewScript.Rows.Add(new string[] { row.Time.ToString(), user, row.Content }); } ReallocateScript(names.Length); }