Solved

combobox problem

Posted on 2011-09-20
2
225 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
Comment Utility
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
Comment Utility
perfect. thank you!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now