//Changing the row color as per the Stream Value | ||||||||||
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) | ||||||||||
{ | ||||||||||
string strA= dataGridView1.CurrentRow.Cells["ColA"].Value.ToString(); | ||||||||||
strA= strA.Trim(); | ||||||||||
if (strA.Equals("India")) | ||||||||||
{ | ||||||||||
dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.LightSkyBlue; | ||||||||||
} | ||||||||||
else if (strA.Equals("PAK")) | ||||||||||
{ | ||||||||||
dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.GreenYellow; | ||||||||||
} | ||||||||||
else if (strA.Equals("USA")) | ||||||||||
{ | ||||||||||
dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.OrangeRed; | ||||||||||
} | ||||||||||
else if (stream.Equals("")) | ||||||||||
{ | ||||||||||
dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.White; | ||||||||||
} | ||||||||||
} |
C# | MVC | DotnetCore | Web API | Blazor | HTML | BootStrap | JavaScript | JQuery | EF | Angular | SQL | Azure
Wednesday, 4 June 2014
Changing the row color as per column Values
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment