This is a migrated thread and some comments may be shown as answers.

RadComboBox Different colors for each element

0 Answers 83 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 26 Jan 2012, 05:34 PM
I am working on a RadComboBox that will be used in a Time Tracking program. The drop down box currently is used to display the beginning date for the current week, next week, and the 6 weeks prior. So, for example, today is the 26 January 2012, so it displays 12/12/11, 12/19/11.... and so on. When a week is selected, it displays time information that the employee has entered so far, so that they can submit it and be paid. I need to, in the RadComboBox, display background colors for each item depending on if they have hit their minimum number of hours needed to submit, which is 37.5. The box is initialized using the following code:

        private void BuildWeeksComboBoxData( )
        {
            WeeksToSelect.Clear();

            // Obtain the "Seed" date, which is current date
            // Then add in the previous six weeks, current week, and week after
            DateTime firstDay = GetFirstDayInWeek(DateTime.UtcNow, DayOfWeek.Monday);

            for (int i = 0; i < 8; i++)
            {WeeksToSelect.Add(firstDay.AddDays(7 * (i - 6)));}

            WeekComboBox.ItemsSource = WeeksToSelect;
        }

Any suggestions on how I can go about accomplishing this?
Tags
ComboBox
Asked by
Alex
Top achievements
Rank 1
Share this question
or