Error - Too many characters in character literal:
private void DataGridView2_CellFormatting(object sender,
DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 8 & e.Value != null)
{
if (e.Value == '"Reserved"') <---- ERROR
e.CellStyle.BackColor = Color.Yellow;
else if (e.Value == '"Occupied"') <---- ERROR
e.CellStyle.BackColor = Color.Red;
else if (e.Value == '"Occupied/Reserved"') <---- ERROR
e.CellStyle.BackColor = Color.OrangeRed;
else if (e.Value == '"Vacant"') <---- ERROR
e.CellStyle.BackColor = Color.Green;
}
}
Last edited by a moderator: