Completed
Last Updated: 21 Jun 2018 14:06 by ADMIN
ADMIN
Dimitar
Created on: 17 May 2018 07:24
Category: Editors
Type: Bug Report
0
FIX. RadDateTimePicker - the PM/AM part is changed when pressing non-numeric key in the hour part
To reproduce:
- Open the attached project.
- Click the day part and press N
- Click the hour part and press N - PM is changed to AM

Workaround:
public RadForm1()
{
    InitializeComponent();
    radDateTimePicker1.Format = DateTimePickerFormat.Custom;
    radDateTimePicker1.CustomFormat = @"yyyy/MM/dd hh:mm:ss tt";
    radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.KeyPress += TextBoxItem_KeyPress;
}
 
private void TextBoxItem_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar == 'n')
    {
        e.Handled = true;
        radDateTimePicker1.Value = DateTime.Now;
    }
}
Attached Files:
0 comments