To reproduce:
CultureInfo culture = new CultureInfo("en-US");
culture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday;
culture.DateTimeFormat.CalendarWeekRule = CalendarWeekRule.FirstFourDayWeek;
this.radCalendar1.ShowRowHeaders = true;
this.radCalendar1.Culture = culture;
Run the attached sample project and try entering "1400/12/30".
CultureInfo info = new CultureInfo("fa-Ir");
this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
this.radDateTimePicker1.CustomFormat = "yyyy/MM/dd";
this.radDateTimePicker1.Culture = info;
The following exception occurs:
at System.Globalization.PersianCalendar.ToDateTime(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond, Int32 era) at System.Globalization.Calendar.ToDateTime(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond) at Telerik.WinControls.UI.ArabicMaskDateTimeProvider.KeyPress(Object sender, KeyPressEventArgs e) at Telerik.WinControls.UI.RadMaskedEditBoxElement.TextBoxItem_KeyPress(Object sender, KeyPressEventArgs e) at System.Windows.Forms.KeyPressEventHandler.Invoke(Object sender, KeyPressEventArgs e) at Telerik.WinControls.RadItem.OnKeyPress(KeyPressEventArgs e) at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyPress(Object sender, KeyPressEventArgs e) at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e) at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m) at System.Windows.Forms.Control.ProcessKeyMessage(Message& m) at System.Windows.Forms.Control.WmKeyChar(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.TextBoxBase.WndProc(Message& m) at System.Windows.Forms.TextBox.WndProc(Message& m) at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at DateTimePickerPersianCalendar.Program.Main() in c:\Projects\DateTimePickerPersianCalendar\DateTimePickerPersianCalendar\Program.cs:line 17 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
To reproduce:
1. Add RadCalendar/or RadDateTimePicker/ and the MaxValue of calendar control to DateTime.MaxValue.
2. Click on the header and an exception is thrown: System.ArgumentOutOfRangeException: 'The added or subtracted value results in an un-representable DateTime.
Parameter name: months'
Workaround:
To work around this issue we can stop showing this pop-up when one of the three last months of the MaxDate.Year is selected in the RadCalendar ViewChanged event:
Please refer to the attached sample project and run it with RadForm2.
Note: the issue is not reproduced consistently.
By default, if you need to format the cells in RadCalendar, the ElementRender event is an appropriate solution. However, it doesn't process the row/column header cell elements illustrated in the attached screenshot.
Workaround:
MonthViewElement mve = (MonthViewElement)this.radCalendar1.CalendarElement.CalendarVisualElement;
How to reproduce: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Light"; this.radCalendar1.ShowRowHeaders = true; this.radCalendar1.AllowMultipleView = true; this.radCalendar1.MultiViewRows = 2; this.radCalendar1.MultiViewColumns = 2; this.radCalendar1.ShowFooter = true; this.radCalendar1.ShowOtherMonthsDays = false; } } Workaround: protected override void OnLoad(EventArgs e) { base.OnLoad(e); MultiMonthViewElement viewElement = this.radCalendar1.CalendarElement.CalendarVisualElement as MultiMonthViewElement; CalendarMultiMonthViewTableElement tableElement = viewElement.FindDescendant<CalendarMultiMonthViewTableElement>() as CalendarMultiMonthViewTableElement; if (tableElement == null) { return; } foreach (RadElement child in tableElement.Children) { MonthViewElement monthViewElement = child as MonthViewElement; if (monthViewElement == null) { continue; } monthViewElement.FindDescendant<CalendarCellElement>().DrawBorder = false; } }
Workaround: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radDateTimePicker1.DateTimePickerElement.Calendar.ElementRender += Calendar_ElementRender; } private void Calendar_ElementRender(object sender, RenderElementEventArgs e) { if (this.radDateTimePicker1.DateTimePickerElement.Calendar.ZoomLevel == ZoomLevel.Days) { return; } CalendarCellElement element = e.Element as CalendarCellElement; if (element != null) { element.WeekEnd = false; } } }
Presently RadCalendar does not support Persian calendar style.
To reproduce: use the following code snippet: radCalendar1.AllowMultipleSelect = true; radCalendar1.ShowRowHeaders = true; radCalendar1.AllowRowHeaderSelectors = true; If you select several cells, they all are selected. Then, click the header row cell. You will notice that the cells from this row are selected but all previously selected cells are cleared. The attached gif file illustrates the behavior. Workaround: use the MouseDown event to store the currently selected cells and then on MouseUp restore the missing selection: public class MyCalendar : RadCalendar { List<DateTime> selectedDays = new List<DateTime>(); protected override void OnMouseDown(MouseEventArgs e) { CalendarCellElement cell = this.ElementTree.GetElementAtPoint(e.Location) as CalendarCellElement; if (cell != null) { bool isHeader = (bool)cell.GetValue(CalendarCellElement.IsHeaderCellProperty); if (isHeader) { selectedDays.Clear(); foreach (DateTime date in this.SelectedDates) { selectedDays.Add(date); } } } base.OnMouseDown(e); } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); foreach (DateTime date in selectedDays) { if (!this.SelectedDates.Contains(date)) { this.SelectedDates.Add(date); } } } public override string ThemeClassName { get { return typeof(RadCalendar).FullName; } } }
Currently, you can use reflection in order to access the properties of the fast navigation popup. Workaround: this.radCalendar1.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Popup; CalendarNavigationElement a = this.radCalendar1.CalendarElement.CalendarNavigationElement; FieldInfo fi = typeof(CalendarNavigationElement).GetField("dropDown", BindingFlags.NonPublic | BindingFlags.Instance); RadDateTimePickerDropDown dropDown = (RadDateTimePickerDropDown)fi.GetValue(a); dropDown.PopupOpening += new RadPopupOpeningEventHandler(dropDown_PopupOpening);
To reproduce: - Add RadCalendar to a blank form and set its AllowMultipleSelect property to true. - Select a date and deselect it right after that. You will notice that the background is not changed. - The cell is actually deselected but it appears as selected since it is the focused cell and the styles are equal. Workaround: Change the style for the focused state, which will allow the user to distinguish between focused and selected cells.
When you click on a Navigation Button with the mouse in RadCalendar and hold the button down, then it scrolls automatically to the next/previous views very fast. Same behavior should be supported by the Fast Navigation Buttons.
HeaderWidth and HeaderHeight properties should be made RadProperties and should be declared at RadCalendarElement. This will allow our users to set these properties in theme.
To reproduce: public Form1() { InitializeComponent(); this.radCalendar1.RangeMinDate = new DateTime(2014, 1, 1); this.radCalendar1.RangeMaxDate = new DateTime(2017, 7, 17); this.radCalendar1.FocusedDate = new DateTime(2014, 2, 4); this.radCalendar1.AllowFastNavigation = true; this.radCalendar1.FastNavigationStep = 1; this.radCalendar1.AllowMultipleView = true; this.radCalendar1.MultiViewColumns = 4; this.radCalendar1.MultiViewRows = 3; this.radCalendar1.CurrentViewRow = 0; this.radCalendar1.CurrentViewColumn = 1; } The user expects when fast navigating forward, the view to be shifted with one year = 12 months. However, each next forward fast navigation moves with 11 months. Workaround: this.radCalendar1.CurrentViewRow = 0; this.radCalendar1.CurrentViewColumn = 0; this.radCalendar1.CalendarElement.PreviousButton.PerformClick();