This question is locked. New answers and comments are not allowed.
Hello-
I am using the DateTime picker in the following Scenario:
My date picker is bound to a View Model property called WeekEndingDate. When the user selects any date from the picker, the form is submitted. In the controller, I am taking the date the user submitted and calculating the true week ending date, e.g. the user selects a Wednesday date, I calculate the following Saturday's date. I am then assigning that week ending date to the view model property WeekEndingDate that is returned to the view. The model's WeekEndingDate that is submitted to the controller is the correct date that the user has selected. However, when the page posts, the date picker does not change to the value of WeekEndingDate that I have assigned to the Model.
Is this functionality not supported that once the user has selected a date in the date picker, the control no longer populates the date from the view model when posting?
Here is my markup:
Thanks
Mike
I am using the DateTime picker in the following Scenario:
My date picker is bound to a View Model property called WeekEndingDate. When the user selects any date from the picker, the form is submitted. In the controller, I am taking the date the user submitted and calculating the true week ending date, e.g. the user selects a Wednesday date, I calculate the following Saturday's date. I am then assigning that week ending date to the view model property WeekEndingDate that is returned to the view. The model's WeekEndingDate that is submitted to the controller is the correct date that the user has selected. However, when the page posts, the date picker does not change to the value of WeekEndingDate that I have assigned to the Model.
Is this functionality not supported that once the user has selected a date in the date picker, the control no longer populates the date from the view model when posting?
Here is my markup:
@( Html.Telerik() .DatePickerFor(x => x.WeekEndingDate) .Name("WeekEndingDate") .OpenOnFocus(true) .HtmlAttributes(new {style = "width:100px;z-index:100;"}) .InputHtmlAttributes(new { style = "z-index:100;" }) .ClientEvents(c => c.OnChange("summaryPageHandler.SubmitParameterForm")))Thanks
Mike