public DataGridViewRow AddToDisableGrid(Resignation resign, string result = null, Color?bgColor = null) { var row = (DataGridViewRow)dataGridViewDisable.RowTemplate.Clone(); row.CreateCells(dataGridViewDisable, resign.ToArray()); if (bgColor != null) { row.DefaultCellStyle.BackColor = bgColor ?? Color.Empty; } if (!string.IsNullOrEmpty(result)) { row.Cells[row.Cells.Count - 1].Value = result; //last col is db action result } dataGridViewDisable.Rows.Add(row); return(row); }
public DataGridViewRow AddToCommitLog(Resignation resign, string commitResult = null, Color?bgColor = null) { var row = (DataGridViewRow)commitLogdataGridView.RowTemplate.Clone(); var itemArray = resign.ToArray(false).ToList(); itemArray.Add(commitResult ?? string.Empty); row.CreateCells(commitLogdataGridView, itemArray.ToArray()); if (bgColor != null) { row.DefaultCellStyle.BackColor = bgColor ?? Color.Empty; } commitLogdataGridView.Rows.Add(row); return(row); }
public DataGridViewRow AddToQueryGrid(Resignation resign, string result = null, Color?bgColor = null) { var row = (DataGridViewRow)dataGridViewQuery.RowTemplate.Clone(); row.CreateCells(dataGridViewQuery, resign.ToArray(false)); if (bgColor != null) { row.DefaultCellStyle.BackColor = bgColor ?? Color.Empty; } if (!string.IsNullOrEmpty(result)) { SetTooltip(row.Cells, result); } dataGridViewQuery.Rows.Add(row); _rowResignationDictionary.Add(row, resign); return(row); }
private void UpdateQueryGridRow(DataGridViewRow row, Resignation resign) { row.SetValues(resign.ToArray(false)); _rowResignationDictionary[row] = resign; //update row }