RadDatePicker : how to reset a date inside text input?

8 posts, 0 answers
  1. Hans van Rijnswoud
    Hans van Rijnswoud avatar
    72 posts
    Member since:
    Sep 2008

    Posted 12 May 2010 Link to this post

    Hi,

    I try on the server site to reset the selected date ( textbox need to be empty).

    The definition of my RadDatePicker is :
    <telerik:RadDatePicker ID="txt_DateFrom" runat="server" Culture="nl-NL" MinDate="2010-02-15" 
                                    MaxDate="" ShowPopupOnFocus="true" /> 

    I try to use this but whithout effect !

    txt_DateFrom.DateInput.Text = string.empty;

    I try to find a solution on the demo area, documentation and forum but nothing founded!

    Can you me please help with this?

    In advance thanks,

    Regards,

    Edwin.
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 12 May 2010 Link to this post

    Hello Edwin,

    I recommend you use the Clear method:
    txt_DateFrom.Clear();

    Best regards,
    Daniel
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Hans van Rijnswoud
    Hans van Rijnswoud avatar
    72 posts
    Member since:
    Sep 2008

    Posted 12 May 2010 Link to this post

    Hi Daniel,

    Thank you for this very quick answer ;-)

    Have a nice day.

    Edwin.
  4. Lubna Ansari
    Lubna Ansari avatar
    65 posts
    Member since:
    Feb 2010

    Posted 02 Aug 2010 Link to this post

    Hi Daniel,

    I'm adding a raddatepicker from codebehind which shows a default current date in date text box. I've tried to clear the date but it is not working. Below is my code.

    RadDatePicker

     

    datepicker = new RadDatePicker();

     

    datepicker.DateInput.DateFormat = objdr[

    "DateTimeFormat"].ToString();

     

    datepicker.MinDate =

    Convert.ToDateTime("01/01/1900");

     

    datepicker.Clear();

    AddControl(para, datepicker, div3, div1, divQuestion

    );

    Regards,
    Lubna.

     

     
  5. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 05 Aug 2010 Link to this post

    Hello Lubna,

    Please download the attached project and let me know if I'm missing something because I failed to reproduce the problem.

    Kind regards,
    Daniel
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Lubna Ansari
    Lubna Ansari avatar
    65 posts
    Member since:
    Feb 2010

    Posted 06 Aug 2010 Link to this post

    My bad... I was resetting the date later.
  7. bdk0172
    bdk0172 avatar
    50 posts
    Member since:
    Oct 2006

    Posted 17 Aug 2010 Link to this post

    Is there a server-side event that gets fired when I remove the text from the datepicker dateinput textbox? 

    Say I have two datepicker controls to select a date range to retrieve records.
    I select 8/10/2010 and 8/17/2010 and then click my retrieve button and it returns records.
    I then delete the dates within the dateinput textboxex by clicking within them and hitting backspace within both datepickers until the textbox is blank.
    When I do a retrieve now, the SelectedDate values are still 8/10/2010 and 8/17/2010 instead of null.

    How can I call Clear() on the controls when the textboxes have been cleared?
  8. bdk0172
    bdk0172 avatar
    50 posts
    Member since:
    Oct 2006

    Posted 17 Aug 2010 Link to this post

    Please disregard my previous post, I was making the same mistake as Lubna.
Back to Top