Automatic Binding of Days, Months, Years to a DropDownList Control
plz reply ASAP...i am a beginner want clear explantion
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 15, 2012, 10:30 PM EDT
Question is not clear.
Please explain your scenario where & when you want to automatically bind ? whether the values are from DB or XML or hard-coded ?
jyothsna chinna23 reputationPosted Aug 15, 2012, 10:44 PM EDT
jyothsna chinna23 reputationPosted Aug 15, 2012, 10:50 PM EDT
sagar patil17 reputationPosted Aug 15, 2012, 11:23 PM EDT
{
//For binding Year
for(int intyear=1900;intyear
drpYear.add(intyear);
}
//For binding month
for(int intmonth=1;intmonth<13 ;intmonth++)
{
drpMonth.add(intmonth);
}
}
//selected months event
selectedIndex_drpMonth()
{
int intyr=convert.toInt16( drpYear.selectedItem.value);
int days=28;
if(intyr%4==0)
{
days=29;
}
swich(drpYear.selectedItem.value)
{
// write all codition for every month.
}
}