7 Answers, 1 is accepted
Please have a look into the full code that I tried which works fine at my end.
ASPX:
<
telerik:RadDatePicker
ID
=
"RadDatePicker1"
runat
=
"server"
>
</
telerik:RadDatePicker
>
<
telerik:RadButton
ID
=
"RadButton1"
Text
=
"Clear"
runat
=
"server"
OnClick
=
"RadButton1_Click"
>
</
telerik:RadButton
>
C#:
protected
void
RadButton1_Click(
object
sender, EventArgs e)
{
RadDatePicker1.Clear();
}
Thanks,
Shinu.
Try the following
C#
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadDatePicker1.Clear();
RadDatePicker1.DateInput.Clear();
}
Thanks.
This does not work for me. I have a standard RadDatePicker control and want to reset the values to null or blank when the clear button is pressed.
I select a date using the calendar and then click the clear button which has the following code in the Click event:
RadDatePicker1.Clear();
RadDatePicker1.DateInput.Clear();
But nothing happens. The click event fires correctly but the RadDatePicker selected date remains in the text box.
Why is the date value not being cleared?
Regards,
Shuja
The control references in my RadAjaxManager didn't seem to work, for some reason. I cleared them and used the Ajax Manager Configuration tool in design mode and that seemed to do the trick. The controls are now being refreshed with AJAX and the reset values are working correctly for the radDatePicker control.
Thanks,
Shuja
Hello Matt,
I'm sorry to hear that this kind of issue left such an impression on you about Telerik tools. Generally, we strive not only to sky rocket the development time and quality of our users, but also to ease up handling issues by providing the necessary support and resources in the process.
And check the love we are still showing Web Forms by taking a look at the recent release notes of the controls to see how many improvements and stabilization efforts were made:
https://www.telerik.com/support/whats-new/aspnet-ajax/release-history/ui-for-asp-net-ajax-r3-2019-(version-2019-3-917)
https://www.telerik.com/support/whats-new/aspnet-ajax/release-history/ui-for-asp-net-ajax-r1-2020-(version-2020-1-114)
As for the specific tech question, the following configuration works on my side:
<telerik:RadDatePicker runat="server" ID="RadDatePicker1" SelectedDate="2/2/2020">
</telerik:RadDatePicker>
<asp:Button ID="Button2" runat="server" Text="Clear Picker" OnClick="Button2_Click" />
protected void Button2_Click(object sender, EventArgs e)
{
RadDatePicker1.Clear();
}
https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax
Regards,
Eyup
Progress Telerik