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 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.
    protected void RadListBox4_ItemDataBound(object sender, RadListBoxItemEventArgs e)
           if (e.Item.Text == "Your Text")
               e.Item.BackColor = System.Drawing.Color.Red;

  3. DevCraft R3 2016 release webinar banner
Back to Top