Listbox Items color changes based on value

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    25 posts
    Member since:
    Jun 2012

    Posted 01 Jun 2011 Link to this post

    Hi guys, is it possible to change the colors of items within  the listbox?

    i gave the listbox a text and datavalue, now the data value is a category value..if the first chosen type value is A..it would highlight other items that have the same value as the initial checked item

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jun 2011 Link to this post

    Hello Bryan,

    You can achieve this by setting the BackColor property to the Item from the ItemDataBound.
    C#:
    protected void RadListBox4_ItemDataBound(object sender, RadListBoxItemEventArgs e)
       {
           if (e.Item.Text == "Your Text")
           {
               e.Item.BackColor = System.Drawing.Color.Red;
           }
       }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top