Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
How to enable scroll while selecting Year in WebDateChooser
posted

Hi,

I used WebdateChooser control for selecting Date Of Birth in a web page. The user may need to select the date which is around 1950. With my current WebDateChooser control, I am not able to scroll the year.

Please suggest me, how to do this. Thanks in Advance.

 

 

  • 49378
    posted

    Hi sivakarthik,

    Thank you for posting in the community.

    I suggest that you try setting the DropDownYearsNumber property in the date chooser's calendar layout:

    WebDateChooser1.CalendarLayout.DropDownYearsNumber = 50;

    Please note that WebDateChooser is now outdated and as of version 11.2 of .NetAdvantage is no longer inlcuded in our product suite. You can find a detailed list of the retired controls and their respective replacements at:

    http://community.infragistics.com/blogs/taz_abdeali/archive/2011/11/17/asp-net-product-changes-in-2011-volume-2.aspx

    Hope this helps.

    • 60
      posted in reply to [Infragistics] Petar Ivanov

      Hi Petar Ivanov,

      Thank you very much for the reply. It works fine.

      And, Instead of doing it in Page Load, I did it in client side, like below.

      <CalenderLayout DropDownYearsNumber="50"  />

      Even this works fine. Thanks again for the help.

       

      Thanks,

      Siva

       

       

       

       

      • 75
        posted in reply to [Infragistics] Petar Ivanov

        Hi Petar,

        Thanks for assisting. Really appreciate it! 

        Cheers

        • 49378
          posted in reply to [Infragistics] Petar Ivanov

          Hi svshivan,

          Please feel free to contact me if you have any questions.

          • 49378
            posted in reply to Shiva

            Hi svshivshan,

            Thank you for your reply and apologies for the delayed response.

            I have researched this scenario and it seems that this functionality is not avialable in WebDateChoose out-of-the-box. However, you can handle the InitializeDateChooser clientside event in order to manually remove all the options which represent past years. For instance:

            Code Snippet
            1. function WebDateChooser1_InitializeDateChooser(oDateChooser){
            2.  
            3.     //get the year dropdown object
            4.     var dropdown = igdrp_getComboById("WebDateChooser1").Calendar.elems[3];
            5.     var elemCount =  dropdown.options.length;
            6.  
            7.     var date = new Date();
            8.     var year = date.getFullYear();
            9.     while(dropdown.options[0].value < year) {
            10.         dropdown.options.remove(dropdown.options[0]);
            11.     }
            12. }

            Please let me know if this helps.

            • 75
              posted in reply to [Infragistics] Petar Ivanov

              Hi Petar,

              Is it possible to enable the year drop down list to hide all previous years? For example, setting DropDownYearsNumber to 11 would show 5 years on either side of the current year. Is it possible to display 10 years after the current year? The user should still be able to select a previous year so the min date value property cannot help. Please clarify. Thanks!

              • 49378
                posted in reply to siva karthik

                Hi Siva,

                Thank you for your reply. Glad that you were able to implement your requirement.

                Please feel free to contact me if you have any further questions regarding this matter.