Problem in clearing value in the RadDatePicker on server side.

6 posts, 0 answers
  1. Prakash
    Prakash avatar
    41 posts
    Member since:
    Jan 2008

    Posted 08 Sep 2009 Link to this post

    hi,

    i am using raddatepicker in my aspx page. i have to clear the value entered in the raddatepicker when the submit button is clicked.

    i tried with raddatepicker.clear() but it is not working.

    below is the code in the aspx page 

    <

     

    telerik:RadDatePicker ID="rdpDueDate" runat="server" Culture="English (United States)"

     

     

     

     

    Width="90px">

     

     

     

     

     <DateInput ID="DateInput1" runat="server" InvalidStyleDuration="100" TabIndex="3">

     

     

     

     

    </DateInput>

     

     

     

     

    <Calendar ID="Calendar1" runat="server" Style="position: absolute; padding: 0 0 0 0px;

     

     

     

    margin: 0 0 0 0px;">

     

     

     

     

    <SpecialDays>

     

     

     

     

    <telerik:RadCalendarDay Repeatable="Today">

     

     

     

     

    <ItemStyle CssClass="specialDay" />

     

     

     

     

    </telerik:RadCalendarDay>

     

     

     

     

    </SpecialDays>

     

     

     

     

    </Calendar>

     

     

     

     

    <DatePopupButton TabIndex="3" />

     

     

     

     

    </telerik:RadDatePicker>

     Any help on this will be greatly appreciated.

     

     

     

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Sep 2009 Link to this post

    Hi Prakash,

    I think you are accessing the RadDatePicker using the wrong  ID. You should be trying it as shown below.

     
    rdpDueDate.Clear(); 
    rdpDueDate.DateInput.Clear(); 

    Regards
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vijay kumar
    Vijay kumar avatar
    3 posts
    Member since:
    Nov 2012

    Posted 08 Nov 2012 Link to this post

    No that is not working for me...please do the needful...it would be great....

    thanks
    vijay kumar N
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Nov 2012 Link to this post

    Hi Vijay,

    Following is the code that I tried to clear the value in RadDatePicker on click of a Button.

    ASPX:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"></telerik:RadDatePicker>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" />

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

    Please provide your code if it doesn't helps.

    Regards,
    Princy.
  6. Vijay kumar
    Vijay kumar avatar
    3 posts
    Member since:
    Nov 2012

    Posted 09 Nov 2012 Link to this post

    this is my code..

    <telerik:RadDatePicker runat="server" ID="dateRsStartDateFrom" TabIndex="11" meta:resourcekey="dateRsStartDateFrom"
           AutoPostBack="False" Calendar-CellDayFormat="%d" Calendar-ColumnHeaderImage=""
           Calendar-DateRangeSeparator=" - " Calendar-DayCellToolTipFormat="dddd, MMMM dd, yyyy"
           Calendar-FastNavigationNextImage="" Calendar-FastNavigationNextText="&amp;gt;&amp;gt;"
           Calendar-FastNavigationPrevImage="" Calendar-FastNavigationPrevText="&amp;lt;&amp;lt;"
           Calendar-NavigationNextImage="" Calendar-NavigationNextText="&amp;gt;" Calendar-NavigationPrevImage=""
           Calendar-NavigationPrevText="&amp;lt;" Calendar-RowHeaderImage="" Calendar-TitleFormat="MMMM yyyy"
           Calendar-ViewSelectorImage="" Calendar-ViewSelectorText="x" Culture="English (United States)"
           Width="90" ClientEvents-OnDateSelected="StartDateFieldChanged">
           <DateInput ID="DateInput1" runat="server" AutoPostBack="False" CausesValidation="False" DateFormat="MM/dd/yyyy"
            LabelCssClass="" Width="" ClientEvents-OnValueChanged="clearResultGrids" onclick="EnableFocusResetOnADateControl(this)" />
           <Calendar ID="Calendar1" runat="server" ShowRowHeaders="false" UseColumnHeadersAsSelectors="False"
            UseRowHeadersAsSelectors="False" ViewSelectorText="x" />
           <DatePopupButton runat="server" CssClass="" ImageUrl="~/Images/calendar24x24.png" HoverImageUrl="~/Images/calendar24x24.png" />
           <ClientEvents OnDateSelected="DateStartFromSelected" />
          </telerik:RadDatePicker>

    from serverside i am also calling in button event 
     dateRsStartDateFrom.Clear();
     dateRsStartDateFrom.DateInput.Clear(); 

    please correct me if i am wrong..
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Nov 2012 Link to this post

    Hi Vijay,

    I couldn't replicate the issue at my end. After inspecting your code I found that you are declaring the OnDateSelected ClientEvent two times for the RadDatePicker. Also make sure that you are not getting any JavaScript errors.

    Regards,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017