Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Controlling the calendars monthrange via keyboard (Read 3976 times)
mw
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Location: Germany
Joined: Jun 6th, 2013
Controlling the calendars monthrange via keyboard
Jun 11th, 2013 at 8:09am
Print Post  
Is there any way to control ( or navigate inside the monthrange) the selection of cells inside the monthrange via keyboard? I couldn't find any settings for this option.

Regards,
Maurice
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Controlling the calendars monthrange via keyboard
Reply #1 - Jun 11th, 2013 at 8:34am
Print Post  
Hi,

At this time there is no built-in support for selection navigation using the keyboard in WpfPlanner. You can handle the appropriate Key* event of the Calendar control and perform the necessary selection adjustments through the Calendar.Selection object manually. For example, the following PreviewKeyDown event handler can be used to modify the selection by using the Left and Right arrow keys:

Code
Select All
if (e.Key == Key.Left || e.Key == Key.Right)
{
	if (_calendar.Selection.IsEmpty)
		return;

	e.Handled = true;
	if (e.Key == Key.Left)
	{
		DateTime first = _calendar.Selection.Ranges[0];
		first = first.AddDays(-1);
		_calendar.Selection.Set(first);
	}
	else
	{
		DateTime last = _calendar.Selection.Ranges[_calendar.Selection.Ranges.Count - 2];
		last = last.AddDays(1);
		_calendar.Selection.Set(last);
	}
} 


Regards,
Meppy
  
Back to top
 
IP Logged
 
mw
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Location: Germany
Joined: Jun 6th, 2013
Re: Controlling the calendars monthrange via keyboard
Reply #2 - Jun 11th, 2013 at 8:41am
Print Post  
Thank you. I'll implement the handling for the events on my own then. Thank's for the example Smiley.

Maybe in future versions of the control it will be implemented  Grin

Regards,
Maurice
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint