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

Clear RadDatePicker

7 Answers 1681 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 10 Oct 2013, 07:33 AM
Team,

I want to clear raddatepicker value. I tried radFromDate.Clear() method but not working...

On reset button click i want clear  date picker value from server side.

Thanks

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Oct 2013, 08:07 AM
Hi Rahul,

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.
0
Rahul
Top achievements
Rank 1
answered on 10 Oct 2013, 09:21 AM
no not working
0
User
Top achievements
Rank 2
answered on 11 Oct 2013, 04:44 PM
Hi,

Try the following
C#
protected void Button1_Click(object sender, EventArgs e)
{
    RadDatePicker1.Clear();
    RadDatePicker1.DateInput.Clear();
}

Thanks.
0
Shuja
Top achievements
Rank 1
answered on 12 Nov 2014, 11:17 AM
Hi,

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

0
Shuja
Top achievements
Rank 1
answered on 12 Nov 2014, 11:42 AM
I figured it out. The above code does work.
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
0
Matt
Top achievements
Rank 1
answered on 13 Jan 2020, 07:04 PM
This should work but still doesn't. It works if I trigger the job from someplace else but if I trigger it from a closed drop down, nothing. Think it's time to dump Telerik.
0
Eyup
Telerik team
answered on 16 Jan 2020, 05:42 PM

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" />
C#:
    protected void Button2_Click(object sender, EventArgs e)
    {
        RadDatePicker1.Clear();
    }
Could you try it out on your side and verify that it works properly? Otherwise, you can temporarily disable AJAX and check for any hidden script errors:
https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Calendar
Asked by
Rahul
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Rahul
Top achievements
Rank 1
User
Top achievements
Rank 2
Shuja
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or