disable many of keys in raddatetimepicker

2 posts, 0 answers
  1. amir
    amir avatar
    1 posts
    Member since:
    Mar 2014

    Posted 01 Mar 2014 Link to this post

    how to disable many of keys in raddatetimepicker?
    I'm using the following code, but I did not give the desired result 

    private void DTP_bDate_KeyPress(object sender, KeyPressEventArgs e)
                e.Handled = char.IsDigit(e.KeyChar);
  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4166 posts

    Posted 05 Mar 2014 Link to this post

    Hello Amir,

    Thank you for contacting Telerik Support.

    If I understand correctly your requirement, you are trying to stop the user to enter some digits in the RadDateTimePicker. You can achieve this via the 
    RadDateTimePicker.DateTimePickerElement.TextBoxElement.KeyPress event:
    this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.KeyPress += KeyPress;

    private void KeyPress(object sender, KeyPressEventArgs e)
        e.Handled = char.IsDigit(e.KeyChar);

    If it is not the exact requirement, please specify more details about the expected behavior. Thus, we would be able to investigate the precise case and suggest an appropriate solution.

    I hope this information helps. Should you have further questions, I would be glad to help.


    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Back to Top