Solved

combobox problem

Posted on 2011-09-20
2
228 Views
Last Modified: 2012-05-12
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
Comment
Question by:1jaws
2 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 500 total points
ID: 36569648
Hi,

I believe you should use RadComboBoxItem.

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

/peter
0
 

Author Closing Comment

by:1jaws
ID: 36569691
perfect. thank you!!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question