How to prohibit month changing when the mouse's left button is down and move mouse outside the calendar in singleselect mode

Answered (Verified) This post has 1 verified answer | 2 Replies | 2 Followers Thread's RSS feed.

user12341234
Points 580
Replied On: Thu, Apr 26 2012 11:19 PM Reply

How to prohibit month changing when the LeftButton of mouse is down and then move mouse outside the calendar panel with single selectmode in XamMonthCalendar

 

There isn't  such a problem with range select mode.

  • Post Points: 20

Verified Answer

[Infragistics] Yanko
Points 20,104
Answered (Verified) Replied On: Mon, May 7 2012 10:38 AM Reply
Verified by user12341234

Hello,

 

I have been looking into your question and I can suggest you handle the ‘ExecutingCommand’ event and implement the following functionality  in its body :

 

   private void xamMonthCalendar1_ExecutingCommand(object sender,Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e)

        {

            if (Mouse.LeftButton == MouseButtonState.Pressed && xamMonthCalendar1.SelectedDate.HasValue == true && Mouse.Captured == xamMonthCalendar1)

            {

              e.Cancel = true;

            }

            if (Mouse.LeftButton == MouseButtonState.Released )

            {

                e.Cancel = false;

            }

        }

 

 

This way when you select a day and move the mouse out of the calendar panel, the month will not be changed.

 

If you need any further assistance on this matter, feel free to ask.

 

Best regards,
Yanko
Developer Support Engineer
Infragistics, Inc.

  • Post Points: 40

All Replies

[Infragistics] Yanko
Points 20,104
Answered (Verified) Replied On: Mon, May 7 2012 10:38 AM Reply
Verified by user12341234

Hello,

 

I have been looking into your question and I can suggest you handle the ‘ExecutingCommand’ event and implement the following functionality  in its body :

 

   private void xamMonthCalendar1_ExecutingCommand(object sender,Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e)

        {

            if (Mouse.LeftButton == MouseButtonState.Pressed && xamMonthCalendar1.SelectedDate.HasValue == true && Mouse.Captured == xamMonthCalendar1)

            {

              e.Cancel = true;

            }

            if (Mouse.LeftButton == MouseButtonState.Released )

            {

                e.Cancel = false;

            }

        }

 

 

This way when you select a day and move the mouse out of the calendar panel, the month will not be changed.

 

If you need any further assistance on this matter, feel free to ask.

 

Best regards,
Yanko
Developer Support Engineer
Infragistics, Inc.

  • Post Points: 40
user12341234
Points 580
Replied On: Mon, May 7 2012 9:53 PM Reply

Hello,

Thank you very much.

  • Post Points: 5
Page 1 of 1 (3 items) | RSS