Hi,
Try below code:
string[] strArray = new string[] { "#BDD8E8", "#ADD8E8", "#CDD8E8", "#DDD8E8" };
int j = 0;
for (int i = 0; i < ListBox1.Items.Count; i++)
{
if (j == strArray.Length - 1)
j = 0;
ListBox1.Items[i].Attributes.Add("style", "background-color:" + strArray[j]);
j++;
}
In strArray variable store your color codes and try. Here I stored only four color codes. you can store ten color codes.