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

RadTimePicker Clear Button

0 Answers 92 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Joem
Top achievements
Rank 2
Joem asked on 15 Sep 2015, 06:21 AM

I wanted to show a clear button to either clear the value or text of the control.

 

The idea is the same as the clear button in 

dateTimePicker.DateTimePickerElement.Calendar.ClearButton

 

But I don't see any ClearButton from its child elements.

 

I came up with the idea to rename the Close Button in

radTimePicker.TimePickerElement.PopupContentElement.FooterPanel.ButtonElement

and to add a clear action on its Click Event.

 

I came up with this code:

radTimePicker.TimePickerElement.PopupContentElement.FooterPanel.ButtonElement.Text = "Clear";
(radTimePicker.TimePickerElement.PopupContentElement.FooterPanel.Children[0] as RadButtonElement).TextElement.Text = "Clear";
(radTimePicker.TimePickerElement.PopupContentElement.FooterPanel.Children[0] as RadButtonElement).ToolTipText = "Clear";
radTimePicker.TimePickerElement.PopupContentElement.FooterPanel.ButtonElement.Click +=
 delegate(object sender, EventArgs e) {  radTimePicker.Value = null;  };​

 

The tooltiptext works as well as the clearing of value. with this, I know that I am using the right button element.

But the Text always revert/return to "Close". 

 

Am I forgetting something?

 

 

No answers yet. Maybe you can help?

Tags
TimePicker
Asked by
Joem
Top achievements
Rank 2
Share this question
or