RangeMinDate and RangeMaxDate properties of RadCalendar are not taken under consideration when a date is being selected.
To reproduce: 1. When set the Disabled to true of special day has not effect this.radCalendar1.SpecialDays.Add(new RadCalendarDay(new DateTime(2014,7, 15))); this.radCalendar1.SpecialDays[0].Disabled = true; 2. When set the Selected and Selectable to false, the special day is still can select and highlight this.radCalendar1.SpecialDays[0].Selected = false; this.radCalendar1.SpecialDays[0].Selectable = false;
Meanwhile, you can workaround this by resetting the property every time you change the number of months that RadCalendar displays. This is shown in the next code snippet: private void radPageViewPage2_ClientSizeChanged(object sender, EventArgs e) { int numViews = this.radPageViewPage2.Size.Height / 240 + 1; radCalendar1.MultiViewRows = numViews; radCalendar1.ShowFastNavigationButtons = true; radCalendar1.ShowFastNavigationButtons = false; }
The following line does not move MultiMonthView to the specific date: radCalendar1.CalendarElement.View.ViewStartDate = new DateTime(DateTime.Now.Year, 1, 1); Workaround: use RadCalendar's FocusedDate property instead: radCalendar1.FocusedDate = new DateTime(2014, 1, 1);
Although RadCalendarDay has a Tooltip property, it does not show any tooltips.
Fast navigation element displays duplicated items
Setting SelectedDate via code in RadCalendar does not work when AllowMultipleSelect is false.
When a RadRichTextBox control is added as a child to RadCalendar, the Space and Enter key input is stolen by the calendar. Workaround is available here: http://www.telerik.com/community/forums/getting-visible-dates-from-radcalendar
The month selector of RadCalendar should fire Calendar.Navigating and Calendar.Navigated events.
To reproduce: select 01/01/0001 and click the previous button
The event should fire so one can customize the appearance on loading.
To reproduce: use the following code snippet: public Form1() { InitializeComponent(); this.radCalendar1.AllowMultipleView = true; this.radCalendar1.MultiViewRows = 3; this.radCalendar1.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Zoom; }
To reproduce: use the following code snippet: public Form1() { InitializeComponent(); this.radCalendar1.AllowMultipleView = true; this.radCalendar1.MultiViewRows = 3; this.radCalendar1.MultiViewColumns = 4; this.radCalendar1.AllowMultipleSelect = true; this.radCalendar1.ShowRowHeaders = true; this.radCalendar1.ShowColumnHeaders = true; this.radCalendar1.AllowColumnHeaderSelectors = true; this.radCalendar1.AllowRowHeaderSelectors = true; this.radCalendar1.ShowViewSelector = true; this.radCalendar1.AllowViewSelector = true; this.radCalendar1.RangeMinDate = new DateTime(2014, 3, 3); this.radCalendar1.RangeMaxDate = new DateTime(2014, 7, 27); this.radCalendar1.FocusedDate = new DateTime(2014, 5, 5); } Please refer to the attached gif file. Workaround: private void Calendar_MouseDown(object sender, MouseEventArgs e) { CalendarCellElement cell = this.radCalendar1.CalendarElement.ElementTree.GetElementAtPoint(e.Location) as CalendarCellElement; if (cell != null && cell.Date < this.radCalendar1.RangeMinDate && (bool)cell.GetValue(CalendarCellElement.IsHeaderCellProperty) == true) { foreach (MonthViewElement monthView in this.radCalendar1.CalendarElement.CalendarVisualElement.Children[0].Children.Last().Children) { { foreach (CalendarCellElement monthCell in monthView.TableElement.Children) { if (monthCell.Date.Month == cell.Date.Month && monthCell.Date.Year == cell.Date.Year && this.radCalendar1.RangeMinDate <= monthCell.Date)// && // (bool)cell.GetValue(CalendarCellElement.IsHeaderCellProperty) == false) { if (char.IsLetter(cell.Text[0])) { //perform column selection if (monthCell.ControlBoundingRectangle.X == cell.ControlBoundingRectangle.X) { this.radCalendar1.SelectedDates.Add(monthCell.Date); } } else { //perform row selection if (monthCell.ControlBoundingRectangle.Y == cell.ControlBoundingRectangle.Y) { this.radCalendar1.SelectedDates.Add(monthCell.Date); } } } } } } } }
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; } } }
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;
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()
RadCalendar should support month selection. I.e, the end-user should be able to press a single button, and all the cells from the current month should become selected. Resolution: #1 This behavior could be achieved very easy with current API, so we are thinking that there is no need to implement it in our RadCalendar as embedded functionality. For example: C# this.radCalendar1.AllowMultipleSelect = true; for (int i = 1; i <= DateTime.DaysInMonth(DateTime.Now.Year,DateTime.Now.Month); i++) { this.radCalendar1.SelectedDates.Add(new DateTime(DateTime.Now.Year, DateTime.Now.Month, i)); } VB Me.radCalendar1.AllowMultipleSelect = True For i As Integer = 1 To DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) Me.radCalendar1.SelectedDates.Add(New DateTime(DateTime.Now.Year, DateTime.Now.Month, i)) Next #2 You can set ShowOtherMonthsDays to false and use ViewSelector. For example: C# this.radCalendar1.AllowMultipleSelect = true; this.radCalendar1.AllowViewSelector = true; this.radCalendar1.ShowViewSelector = true; this.radCalendar1.ShowOtherMonthsDays = false; VB Me.radCalendar1.AllowMultipleSelect = True Me.radCalendar1.AllowViewSelector = True Me.radCalendar1.ShowViewSelector = True Me.radCalendar1.ShowOtherMonthsDays = False
RadCalendar crashes when the focused date is set to a value out of the current view and adding rows/columns is performed.
Set the RadCalendar's NavigationNextImage and NavigationPrevImage properties in design time through property grid. The assigned images is shown in the designer. When run the application the images do not be shown.
radCalendar €“ set AllowMultipleView to be true. Set MultiViewColumn and MultiViewRow to be 2. Try to change the Culture and you will see error: Object reference not set to an instance of an object.