Clear RadDatePicker

6 posts, 0 answers
  1. Rahul
    Rahul avatar
    142 posts
    Member since:
    May 2009

    Posted 10 Oct 2013 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Oct 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rahul
    Rahul avatar
    142 posts
    Member since:
    May 2009

    Posted 10 Oct 2013 Link to this post

    no not working
  5. User
    User avatar
    8 posts
    Member since:
    Jul 2013

    Posted 11 Oct 2013 Link to this post

    Hi,

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

    Thanks.
  6. Shuja
    Shuja avatar
    30 posts
    Member since:
    Mar 2011

    Posted 12 Nov 2014 Link to this post

    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

  7. Shuja
    Shuja avatar
    30 posts
    Member since:
    Mar 2011

    Posted 12 Nov 2014 in reply to Shuja Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017