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
15
Using infragistics WebDatePicker disable alternative days
posted

I am using infragistics WebDatePicker i need to disable and enable alternative dates like i want to enable only "Monday", "Wednesday", "Friday" and disable remaining days in a month, please any one can help me.

Parents
No Data
Reply
  • 1700
    Verified Answer
    Offline posted

    Hello,

    You can disable specific dates by setting the DropDownCalendarID to the ID of a WebMonthCalendar and handle its RenderDay client-side event. Inside it the day should be checked and depending on its day of week number (dow property), the day should be set to disabled. It could be done with the following markup and JavaScript code:

     

     <ig:WebDatePicker ID="WebDatePicker1" runat="server" DropDownCalendarID="WebMonthCalendar1">
    </ig:WebDatePicker>
     <ig:WebMonthCalendar ID="WebMonthCalendar1" runat="server">
            <ClientEvents RenderDay="RenderDay" />
     </ig:WebMonthCalendar>

    function RenderDay(sender, e) {
               //disable all dates that are different from Mondat/Wednessday/Friday
                if (e.get_day().dow != 1 && e.get_day().dow != 3 && e.get_day().dow != 5) {
                    e.get_day().set_disabled(true);
                } 

    Please let me know if you have any questions.

    Regards,
    Ivan Kitanov

Children