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

Custom Error message when args.IsParsingSuccessful = false;

2 Answers 71 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Wilfred
Top achievements
Rank 1
Wilfred asked on 27 Sep 2017, 03:44 PM

Hi,

Wondering if there's a way to override the default error message, "Error" when args.IsParsingSuccessful is set to false in the ParseDateTimeValue event handler. Would like to provide something more descriptive to my users.

Thanks

2 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 29 Sep 2017, 05:25 PM
Hi Wilfred,

The control provides ErrorTooltipContent property - you could modify it in the event handler as desired once the parsing is not successful:
private void RadDateTimePicker_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
{
    (sender as RadDatePicker).ErrorTooltipContent = "Another Error";
    args.IsParsingSuccessful = false;
}

Hope this helps. If you have any other questions or concerns, please let us know.

Regards,
Kalin
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Wilfred
Top achievements
Rank 1
answered on 29 Sep 2017, 06:25 PM

Exactly what I was looking for. Was looking at properties of the wrong control.

 

Thanks!

Tags
DatePicker
Asked by
Wilfred
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Wilfred
Top achievements
Rank 1
Share this question
or