Surendra Sharma

Surendra Sharma

Search This Blog

Friday, June 4, 2010

To Display some ListItem in different colour in ListBox in ASP.NET

foreach (ListItem objTempItem in ListBox2.Items)

{

   //Code to change background colour of listitem

   //objTempItem.Attributes.Add("style", "background-color: RED");



  //Code to change text or foreground colour of listitem

  objTempItem.Attributes.Add("style","color:RED");

}

No comments:

Post a Comment