To reproduce the issue:
1. Add a RadDateTimePicker control to a Windows Forms application.
2. Use the "ar-SA" culture.
3. Attempt to manually enter a date in the RadDateTimePicker control using letters or special characters.
Dim hijriCulture As New CultureInfo("ar-SA")
hijriCulture.DateTimeFormat.Calendar = New HijriCalendar()
RadDateTimePicker1.Format = DateTimePickerFormat.Custom
RadDateTimePicker1.Culture = hijriCulture
Hello, Riziq,
Thank you for reporting this.
Currently, you can use the following workaround when using the Arabic culture:
Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider = New MyArabicMaskDateTimeProvider(Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Mask, Me.RadDateTimePicker1.Culture, Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement)
Public Class MyArabicMaskDateTimeProvider
Inherits ArabicMaskDateTimeProvider
Public Sub New(mask As String, culture As CultureInfo, owner As RadMaskedEditBoxElement)
MyBase.New(mask, culture, owner)
End Sub
Protected Overrides Function HandleKeyPress(part As MaskPart, e As KeyPressEventArgs) As Boolean
Dim value As Integer = 0
If Not Integer.TryParse(e.KeyChar.ToString(), value) Then
Return True
End If
Return MyBase.HandleKeyPress(part, e)
End Function
End Class
Regards,
Nadya | Tech Support Engineer
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.