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


1 Answer 29 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Tash asked on 01 May 2012, 06:34 PM
I find that in the raddatepicker if you manually type in the date and try to access what is in the object I get 01/01/0001 instead of what was typed in. Is there some setting to set to manual typing is allowed?

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 02 May 2012, 08:36 PM

You did not specify if you are accessing the typed in value on the client or in code behind.

Here's a simple sample to assist with client-side accessing of a value that is typed into the DateInput TextBox of the RadDatePicker ujsing JavaScript:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<head runat="server">
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
    <script type="text/javascript">
        function DisplayDateInputDate(sender, args) {
            var date = sender.get_selectedDate();
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <telerik:RadDatePicker ID="rdpMinDate" runat="server" Width="140px" AutoPostBack="true"
            DateInput-EmptyMessage="MinDate" MinDate="01/01/1000" MaxDate="01/01/3000" DateInput-ClientEvents-OnValueChanged="DisplayDateInputDate">
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>

And to access the value in server-side code:

using Telerik.Web.UI;
public partial class Default : System.Web.UI.Page
    protected void rdpMinDate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        Label1.Text = "You selected: " + e.NewDate.Value.ToShortDateString();

See this in action at

Hope this helps!
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question