Hi everyone,
I want to set the RightToLeft behaviour for the schedule control.
I set the RightToLeft property like this.
this.RightToLeft = System.Windows.Forms.RightToLeft.Yes; //For the Form
this.scheduleControl1.RightToLeft = RightToLeft.Yes; //For the schedule control
It loads with the Month view. After that when I change the view to Day it crashes
The error message is
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.
Parameter name: months
at System.DateTime.AddMonths(Int32 months)
at Syncfusion.Windows.Forms.Schedule.NavigationCalendar.AdjustSelectionsByMonth(Int32 offSet)
at Syncfusion.Windows.Forms.Schedule.NavigationCalendar.set_DateValue(DateTime value)
at Syncfusion.Windows.Forms.Schedule.ScheduleControl.PerformSwitchToScheduleViewTypeClick(ScheduleViewType t)
at GridScheduleSample.Form1.menuItem12_Click(Object sender, EventArgs e) in E:\Temp\CS\Form1.cs:line 786
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItem.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I want to know whether the schedule control supports RightToLeft feature. If so how can I fix this?
Thanks in advance.
Risath
JJ
Jisha Joy
Syncfusion Team
April 11, 2008 05:54 AM UTC
Hi Risath,
Thank you bringing this issue to our attention.
We suspect the issue to be a defect. We have reported this to our developers and we will update you once we get back from them.
Please let me know if you need any further assistance.
Regards,
Jisha
JJ
Jisha Joy
Syncfusion Team
April 11, 2008 05:54 AM UTC
Hi Risath,
Thank you bringing this issue to our attention.
We suspect the issue to be a defect. We have reported this to our developers and we will update you once we get back from them.
Regards,
Jisha
AD
Administrator
Syncfusion Team
April 11, 2008 09:05 AM UTC
I cannot reproduce this problem using the samples we ship. Can you? I am using the 6.2.0.32RC that is available in the downloads area of this website.
Is this problem related to a particular culture setting?
Does the problem occur with a calendar that is empty of appointments? If not, check whether your list of appointments is ordered as described in your earlier forum thread.
AD
Administrator
Syncfusion Team
April 11, 2008 10:16 AM UTC
Jisha showed me how to see this problem. If you use the Form's menu item to change to Day view, then the exception does occur. I was using the right-click context menu to change to the Day view. Doing the change to Day view through the context menu does not throw this exception that is seen when you use the main menu item to change the view.
In our sample, you can avoid this problem by changing how the view is set. Instead of using the PerformSwitchToScheduleViewTypeClick, use the SwitchTo method on the ScheduleGrid object as shown in this code.
private void menuItem12_Click(object sender, System.EventArgs e)
{
if (this.scheduleControl1.ScheduleType != ScheduleViewType.Day)
{
this.scheduleControl1.GetScheduleHost().SwitchTo(ScheduleViewType.Day, true);
// this.scheduleControl1.PerformSwitchToScheduleViewTypeClick(ScheduleViewType.Day);
}
}
We will correct the PerformSwitchToScheduleViewTypeClick code in library so that method should also work in the future.
RI
Risath
April 16, 2008 05:45 AM UTC
Thanks a lot for your replies.