This is a migrated thread and some comments may be shown as answers.

URGENT !! Datetimepicker validation

5 Answers 179 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 04 Jul 2008, 04:08 AM
Hi,
i have used the following code in 'valueChanged' event, But it does not help

dtpLDDate.DateTimePickerElement.TextBoxElement.TextBoxItem.ReadOnly = true;


Minimum date value that we have is 1753(year), if in any case user enters any value less than 1753(year), then the datetimepicker control does not fire any event(Neither 'valuechanged' nor 'keypressed').
Please suggest me some solution to fix this problem.
Please reply soon.

5 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 04 Jul 2008, 06:41 AM
Hello Vijay,

Thank you for contacting us.
At first I would like to ask you what version of RadControls for WinForms you currently use?
Currently the MinDate value cannot be set to a date before 1900. Otherwise it would throw an exception if you are using the current version. The min date (1,1,1900) is the minimum effective date we have put as a lowest date bound and the user cannot set it to something before than this date. If you are using the current version Q1 SP1 and try to set the date less than the (1,1,1900) could you please give me some instructions how to reproduce this ? 
The issue with the Key events in RadDateTimePicker is known and we will have a fix for it for the next version. However, there is a workaround that lets you subscribe to the KeyEvents: RadDateTimePickerElement has a property named TextBoxElement. This property holds the child mask box shown in the  RadDateTimePicker and you can subscribe to its Key events and receive KeyUp, KeyDown or KeyPress.

I can assure you that we will consider changing the Min, Max dates behavior in RadDateTimePicker but at the moment in this version you cannot set a date before 01.01.1900.

If you have more questions please write me back.

Kind regards,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Vijay
Top achievements
Rank 1
answered on 07 Jul 2008, 04:32 AM
TextBoxElement events are working fine.
Thanks a lot for your kind support
0
Boyko Markov
Telerik team
answered on 09 Jul 2008, 01:12 PM
Hello Vijay,

I'm happy to hear that everything works as expected.
Do not hesitate to write me back if you need more instructions about RadDateTimePicker.

Kind regards,
Boyko Markov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
moh salhi
Top achievements
Rank 1
answered on 09 Jun 2010, 09:06 AM
hi ,

can you help me wiht sample code, to add key press event to rad datetimepicker
remark : i have version 2010 Q1 sp1
thanks .
0
Martin Vasilev
Telerik team
answered on 14 Jun 2010, 01:55 PM
Hi moh salhi,

Thank you for contacting us.

You can subscribe to the KeyPress event of RadDateTimePicker as shown below:
public Form1()
{
    InitializeComponent();
    this.radDateTimePicker1.KeyPress += new KeyPressEventHandler(radDateTimePicker1_KeyPress);
}
void radDateTimePicker1_KeyPress(object sender, KeyPressEventArgs e)
{
    MessageBox.Show("KeyPress");
      
}

Let me know if you have any other questions.

Greetings,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Vijay
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Vijay
Top achievements
Rank 1
moh salhi
Top achievements
Rank 1
Martin Vasilev
Telerik team
Share this question
or