Columns werden nach fehlertyp gefärbt

This commit is contained in:
Husky
2018-06-30 13:59:14 +02:00
parent d30876db34
commit 4c6b644827
3 changed files with 95 additions and 3 deletions

View File

@@ -33,7 +33,14 @@ namespace SanSystem
DataGridViewRow dgvw = dGObjekte.Rows[i];
Inspektionsobjekt tmp = (Inspektionsobjekt)dgvw.DataBoundItem;
if (tmp == null) continue;
if(tmp.Projektnummer == null) dGObjekte.Rows[i].DefaultCellStyle.BackColor = Color.Red;
dgvw.DefaultCellStyle.BackColor = Color.White;
if (
(tmp.BisPunkt== null || tmp.BisPunkt.Equals(""))
|| (tmp.VonPunkt == null || tmp.VonPunkt.Equals(""))
|| (tmp.Objektbezeichnung == null || tmp.Objektbezeichnung.Equals(""))
|| tmp.Kanalrohrweite.Equals(0)
) dgvw.DefaultCellStyle.BackColor = Color.Olive;
if(tmp.Projektnummer == null) dgvw.DefaultCellStyle.BackColor = Color.Red;
}
return true;
@@ -49,6 +56,13 @@ namespace SanSystem
btn_add.Text = Global.Instance.language.Labels["add_objekt"];
gb_error_messages.Text = Global.Instance.language.Labels["error_messages"];
lbl_grounddata.Text = Global.Instance.language.Labels["error_groundData"];
lbl_projwrong.Text = Global.Instance.language.Labels["error_projwrong"];
label1.BackColor = Color.Red;
label5.BackColor = Color.Olive;
loadObjekte(streetname);
txt_strasse.Text = streetname;
@@ -126,9 +140,16 @@ namespace SanSystem
private void dGObjekte_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
//dGObjekte.Rows[0].DefaultCellStyle.BackColor = Color.Red;
CheckEntries();
dGObjekte.Columns["StrasseName"].Visible = false;
dGObjekte.Columns["OrtName"].Visible = false;
dGObjekte.Columns["Projektnummer"].Visible = false;
dGObjekte.Columns["Sanierung"].Visible = false;
}
private void dGObjekte_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
CheckEntries();
}
}
}