Approved
Last Updated: 06 May 2016 13:13 by ADMIN
ADMIN
Hristo
Created on: 15 Apr 2016 08:02
Category: Editors
Type: Bug Report
1
FIX. RadDateTimePicker - navigation with the arrow keys should cycle through all editable parts, the issue is when you are in the beginning or end of the mask
How to reproduce:
 public RadForm1()
 {
     InitializeComponent();

     this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
     this.radDateTimePicker1.CustomFormat = "MM/dd/yyyy";
     this.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Zoom;
     ((Telerik.WinControls.UI.MaskDateTimeProvider)this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider).AutoSelectNextPart = true;
 }

Workaround:
 public RadForm1()
 {
     InitializeComponent();

     this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
     this.radDateTimePicker1.CustomFormat = "MM/dd/yyyy";
     this.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Zoom;
     ((Telerik.WinControls.UI.MaskDateTimeProvider)this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider).AutoSelectNextPart = true;

     this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.KeyDown += TextBoxElement_KeyDown;

 }

 private void TextBoxElement_KeyDown(object sender, KeyEventArgs e)
 {
     RadMaskedEditBoxElement tb = (RadMaskedEditBoxElement)sender;
     MaskDateTimeProvider provider = (MaskDateTimeProvider)tb.Provider;

     switch (provider.List[provider.SelectedItemIndex].type)
     {
         case PartTypes.Month:
             if (e.KeyCode == Keys.Left)
             {
                 provider.SelectedItemIndex = provider.List.Count;
             }

             break;
         case PartTypes.Year:
             if (e.KeyCode == Keys.Right)
             {
                 provider.SelectedItemIndex = -1;
             }
             break;
     }
 }
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments