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?