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

Binding saved value on Edit Razor Page

2 Answers 227 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
May
Top achievements
Rank 1
May asked on 08 Nov 2018, 01:57 PM

I want to see the saved date in the text box on the edit page.  Everything works ok on my create page but for some reason I can't get the value to show on my edit page.

This will display the date:

  @Model.UsrRequest.Start

This does not:

@(Html.Kendo().DatePicker().Name("UsrRequest.Start").Value("Model.UsrRequest.Start"))

What am I missing?

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 13 Nov 2018, 08:38 AM
Hi May,

The date is not displayed as a string is passed to the Value method - not the DateTime value from the model.

e.g.

.Value("Model.UsrRequest.Start"))

Remove the highlighted quotes and in case the Model.UsrRequest.Start field has a value, the date picker will display it.

e.g.

.Value(Model.UsrRequest.Start))


Regards,
Georgi
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
May
Top achievements
Rank 1
answered on 13 Nov 2018, 01:28 PM
Perfect!   Thank you!
Tags
Date/Time Pickers
Asked by
May
Top achievements
Rank 1
Answers by
Georgi
Telerik team
May
Top achievements
Rank 1
Share this question
or