Colour coding in ListBox
1 Answers
for (int i = 0; i < ListBox1.Items.Count; i++)
{
if(condition)
{
ListBox1.Items[i].Attributes.CssStyle.Add(“color”, “green”);
}
else ((ds.Tables[0].Rows[i][3].ToString() == “1”) & (ds.Tables[0].Rows[i][2].ToString() == “1”))
{
ListBox1.Items[i].Attributes.CssStyle.Add(“color”, “red”);
}
}