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

[Solved] Datepicker - Not getting the value

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Won
Top achievements
Rank 1
Won asked on 09 Sep 2010, 04:16 PM
I am able to change date and save too to database.
 <p>
       <label for="EventDate">Hired Date:</label>
       <%= Html.TextBox("START_DT", String.Format("{0:g}", Model.empExperience.START_DT.ToShortDateString()))%>
       <%= Html.ValidationMessage("Hired Date", "*")%>
 </p>

However, I am not able to save the modified date on the datepicker. It is not getting the value.
Should I add more code?

<P>
<%= Html.Telerik().DatePicker()
                .Name("selectedDate")
                .Value(Model.empExperience.START_DT)
                .MinDate(new DateTime(1990, 1, 1))
   %>
</P>





2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 09 Sep 2010, 04:46 PM
Hello Won,

You need to name DatePicker as the name of the property, which you change. In other words, if you need to update START_DT property, you need to name datepicker UI component like so:
Name("empExperience.START_DT")
You can also use Html.Telerik().DatePickerFor(m => m.empExperience.START_DT). In this case you should not call Name() method.

Sincerely yours,
Georgi Krustev
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
0
Won
Top achievements
Rank 1
answered on 09 Sep 2010, 05:11 PM
Thanks. That works.
But it did not work with "Name("empExperience.START_DT")".
It works when it is "Name("START_DT")".

I am not sure why, but it works that way.

Sorry, that I posted this on Grid.
Tags
Grid
Asked by
Won
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Won
Top achievements
Rank 1
Share this question
or