public void ResultsCellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { // Set the background to red for negative values in the Balance column. ChurnStatus status = ChurnStatuses.GetStatus(_view.Rows[e.RowIndex].Cells["Status"].Value); switch (status) { case ChurnStatus.Added: e.CellStyle.BackColor = ChurnStatuses.Added; break; case ChurnStatus.Deleted: e.CellStyle.BackColor = ChurnStatuses.Deleted; break; case ChurnStatus.Changed: e.CellStyle.BackColor = ChurnStatuses.Changed; break; } //if ((e.ColumnIndex == 3) && e.Value != null) //{ // DataGridViewCell cell = _view.Rows[e.RowIndex].Cells[e.ColumnIndex]; // cell.ToolTipText = ChurnStatuses.GetToolTipText(status); //} }
public static string GetToolTipText(ChurnStatus status) { if (status == ChurnStatus.Unchanged) { return("This file has not changed."); } return(String.Format("This file has been {0}", status.ToString())); }
public static string GetShortCode(ChurnStatus status) { switch (status) { case ChurnStatus.Added: return("Add"); case ChurnStatus.Deleted: return("Del"); case ChurnStatus.Changed: return("Ch"); } return("Un"); }