Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

combobox problem

ddDate is a RadCombobox and that line starts with ddDate is giving error saying invalid argument about adding items to combobox..
 DateTime dateCounter = System.DateTime.Now;
            System.DateTime today = System.DateTime.Now;

            while (dateCounter >= today.AddDays(-30))
            {
                 
                ddDate.Items.Add(new ListItem(dateCounter.ToString("d"), dateCounter.ToString("d")));
                dateCounter = dateCounter.AddDays(-1);
            }  
0
1jaws
Asked:
1jaws
1 Solution
 
pivarCommented:
Hi,

I believe you should use RadComboBoxItem.

ddDate.Items.Add(new RadComboBoxItem(dateCounter.ToString("d"), dateCounter.ToString("d")));

/peter
0
 
1jawsAuthor Commented:
perfect. thank you!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now