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
1735
How to Cancel the Date selection event for deyond perticular date range outside in OutlookCalendarPane
posted

Hi,

I have used the following sample for my module

http://es.infragistics.com/samples/windows-forms/schedule/windayview-outlook-view

I would want to Restrict  or not perform any operation when the user to Clicks on date in Calendar which is outside the MinDate and MaxDate range

By setting the MinDate/MaxDate of calendar, all the other dates becomes disabled(which is fine). But now if you click on say a date before MaxDate than it will navigate to the MaxDate and not remain on the day.

For Example, if  I open with a date range  16th – 22nd Feb and setting it as MinDate and MaxDate, all the others dates are disabled. Now if i click on 9th Feb then it will navigate to Day View and display First Day of week i.e. 16th Feb. i dont want it to navigate at all i.e. not perform any operation at all kind of canelling the event itself

Thanks,

Chitra

  • 23930
    Offline posted

    Hello Chitra,

    I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.

    Thank you for using Infragistics Components.

  • 23930
    Offline posted

    Hi Chitra,

    Thank you for posting in our forums.

    What you could do in your case is to detect if the user clicked on a disable date and if he/she did to cancel the BeforeActiveDayChanged event of the calendar info. In order to do this you will have to create a class that inherits the UltraMonthViewMulti (and do the same for any other control, for which you want to disable this functionality). After that overwrite the WndProc method (this method fires before the BeforeActiveDayChanged event) and check if the message is either for mouse click or double click. If it is check if the user clicked a date that is disabled and cancel the BeforeActiveDayChanged if he/she did.

    I have attached a sample that demonstrates this suggestion.

    Please let me know if you have any additional questions.

    WG_DisableDates.zip