We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DropDownCalendarControl years dropdown

Hi,
I am using DropDownCalendarControl and I se current Value to be DateTime.Now. In years dropdown I see years from 2002-2011. The number of years listed in years dropdown can be changed? I need to use it to select birth date and it's possible that the user want to select 1940 and for that, he need to pres Prev arrow too many times.

There is a solution on that?

Thank you.

1 Reply

SS Suresh Sekarean Syncfusion Team September 24, 2007 01:30 PM UTC

Hi Iryna,

Currently DropDownCalendar Control do not support to specify the number of combo items for the year section.

Using reflection, We can modify the number of Combo Items to be shown in the DropDownCalendar control. Please refer the below code snippet.

[C#]

DropDownCalendarControl DropDown = new DropDownCalendarControl();
//Access the variable 'm_iCountYearInCombo' which specify the number of combo items for the year section
FieldInfo count_Years = DropDown.GetType().GetField("m_iCountYearInCombo", BindingFlags.Instance | BindingFlags.NonPublic);
//Set new value to this variable
count_Years.SetValue(DropDown, 70);

Please refer the below sample,

http://websamples.syncfusion.com/samples/Tools.Web/5.2.0.25/F68365/main.htm

Sorry for the inconvenience if any caused.

Thanks for using Syncfusion products.

Thanks,
Sureshsekaran.

Loader.
Live Chat Icon For mobile
Up arrow icon