void column_MovedUp(object sender, EventArgs e) { var column = (ColumnSettings)sender; var index = ColumnsList.IndexOf(column); ColumnsList.Remove(column); ColumnsList.Insert(index - 1, column); ResetColumns(); column.SelectControl(); }
void column_ColumnRemoved(object sender, EventArgs e) { var column = (ColumnSettings)sender; var index = ColumnsList.IndexOf(column); ColumnsList.Remove(column); ResetColumns(); if (ColumnsList.Count > 0) { ColumnsList.Last().SelectControl(); } else { chkColumnLabels.Select(); } }