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

DatePicker doesn't clear invalid value

2 Answers 79 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Triet Nguyen Cong
Top achievements
Rank 2
Triet Nguyen Cong asked on 01 Aug 2010, 07:42 AM
Hi Telerik team,

In DatePicker control (latest version), I enter free-text (sample: adfadfadf), the controls will keep it and doesn't clear this invalid value. In other version, DatePicker control will clear invalid value automatically. How can I work-around this problem?

Thanks,
Triet

2 Answers, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 04 Aug 2010, 11:15 AM
Hi Triet Nguyen Cong,

You can use ParseDateTimeValue event. Use the code below.
private void timepicker_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
{
    if (args.IsParsingSuccessful == false)
    {
        (sender as RadTimePicker).DateTimeText = "";
    }
}


Best wishes,
Boyan
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 09 Aug 2010, 08:08 AM
Thanks Boyan!

It works exactly what I expect.
Tags
DatePicker
Asked by
Triet Nguyen Cong
Top achievements
Rank 2
Answers by
Boyan
Telerik team
Triet Nguyen Cong
Top achievements
Rank 2
Share this question
or