Skip to content

Commit f5257a1

Browse files
Merge pull request #3072 from telerik/new-kb-prevent-tooltip-raddatetimepicker-error-093d36f751834d099a3466e8705cd6d9
Added new kb article prevent-tooltip-raddatetimepicker-error
2 parents 66654af + f2264a9 commit f5257a1

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Preventing Tooltip Display for Error Content in RadDateTimePicker
3+
description: Learn how to prevent the tooltip of the RadDateTimePicker control in WPF from showing when its content equals "Error".
4+
type: how-to
5+
page_title: Avoid Tooltip Display for RadDateTimePicker Error Content
6+
meta_title: Avoid Tooltip Display for RadDateTimePicker Error Content
7+
slug: prevent-tooltip-raddatetimepicker-error
8+
tags: raddatetimepicker, wpf, tooltip, error, isparsingsuccessful, istooltipopen
9+
res_type: kb
10+
ticketid: 1691793
11+
---
12+
13+
## Environment
14+
15+
<table>
16+
<tbody>
17+
<tr>
18+
<td> Product </td>
19+
<td> RadDateTimePicker for WPF </td>
20+
</tr>
21+
<tr>
22+
<td> Version </td>
23+
<td> 2025.2.521 </td>
24+
</tr>
25+
</tbody>
26+
</table>
27+
28+
## Description
29+
30+
I want to prevent the tooltip of the [RadDateTimePicker](https://docs.telerik.com/devtools/wpf/controls/raddatetimepicker/overview) control from showing when its content is set to Error.
31+
32+
## Solution
33+
34+
To achieve this behavior, subscribe to the `ParseDateTimeValue` event of the RadDateTimePicker control. Check the `IsParsingSuccessful` property of the event arguments, and if it is false, set the `IsTooltipOpen` property of the control to false. Use the `Dispatcher.BeginInvoke` method to delay this logic.
35+
36+
Follow these steps:
37+
38+
1. Subscribe to the `ParseDateTimeValue` event of RadDateTimePicker.
39+
2. Implement the logic to check `IsParsingSuccessful` in the event handler.
40+
3. If `IsParsingSuccessful` is false, use `Dispatcher.BeginInvoke` to set `IsTooltipOpen` to false.
41+
42+
Example implementation:
43+
44+
```csharp
45+
private void RadDateTimePicker_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
46+
{
47+
if (!args.IsParsingSuccessful)
48+
{
49+
Dispatcher.BeginInvoke(new Action(() =>
50+
{
51+
this.dateTimePicker.IsTooltipOpen = false;
52+
}));
53+
}
54+
}
55+
```
56+
57+
Attach the event handler to your RadDateTimePicker instance:
58+
59+
```csharp
60+
this.dateTimePicker.ParseDateTimeValue += RadDateTimePicker_ParseDateTimeValue;
61+
```
62+
63+
This approach prevents the tooltip from displaying when parsing the input fails.

0 commit comments

Comments
 (0)