quick question on DDL?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all!

Have a quick question on drop down list. Need to make a year ddl, 1900 to
1987. Is there a quick way to do this. I'm not binding this, just loading it
in the items collection.

Thanks!!!

Rudy
 
you just create a simple loop:

for(int yearVal = 1900; yearVal <= 1987; yearVal++)
{
// cboYears is a ComboBox
cboYears.Items.Add(yearVal.ToString());
}
 
Thank You Manohar!!!

Manohar Kamath said:
you just create a simple loop:

for(int yearVal = 1900; yearVal <= 1987; yearVal++)
{
// cboYears is a ComboBox
cboYears.Items.Add(yearVal.ToString());
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top