Grid column does not use DateTimePicker when in edit mode

1 Answer 43 Views
DateInput Grid
Lawrence
Top achievements
Rank 1
Lawrence asked on 15 Dec 2025, 09:40 AM

I have created a fresh project with the following variables:

  • Visual Studio 22 Community (Version 17.14.21 )
  • Progress Telerik UI for ASP.NET Core Extension 2025.4.1110.199
  • .NET 9.0
  • Kendo UI v2025.4.1111

I am trying to create a simple grid as following that has an editable `DateTime?` column:

https://netcorerepl.telerik.com/GpFmvpEr29UDYPJN54

It works in the REPL link above, but if I press "Edit" on my local project, the DateTime column defaults to a text input without the datetimepicker buttons (see Attachment-1.png), I'm not sure what I am missing.

 

I've checked that `/Views/Shared/Editor/Templates/DateTime.cshtml` exists and the content is as follows:

@model DateTime?

@(Html.Kendo().DateTimePickerFor(m => m).HtmlAttributes(new { title = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("")}))

I've placed either `[DataType("Date")]` or `[DataType("DateTime")]` annotation on the class property definition and neither worked.

I've used `.EditorTemplateName("DateTime")` and/or `[UIHint("DateTime")]` and it didn't work.

I've created a new Template type and it didn't work.

I'm not sure what else to try to make it work.

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 17 Dec 2025, 12:22 PM

Hi Lawrence,

Thank you for providing detailed descriptions on what you have tried.

By default the Grid will get the editors from the the ~/Views/Shared/EditorTemplates folder. It seems that you have added one extra sub-folder after Editor. Please ensure that you have the DateTime.cshtml file in the EditorTemplates folder and see if the behavior changes.

In case the issue persists, please send us a sample project where the issue is replicated so we can examine it and look for the root cause.

If you would like more information on how Grid editors can be configured you may find the article below interesting.

https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/data-management/grid/editing/inline#editors


Regards,
Viktor Tachev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lawrence
Top achievements
Rank 1
commented on 18 Dec 2025, 08:17 AM

Hi Viktor,

Correction on my part, the DateTime.cshtml file is indeed in "/Views/Shared/EditorTemplates". The folder location separating Editor and Templates in my first post was a typo on my side.

I tried creating another new project with the newer Kendo UI v2025.4.1217 and I'm still getting the same issue. Refer the attached screenshot (Screenshot 2025-12-18 143311.png).

I have "Progress Telerik UI for ASP.NET Core Extension 2025.4.1216.1372" installed both on visual studio 2022 community and visual studio 2026 community insider. Running the solution on either editor still gives me the same issue.

How do I share a sample project with you Viktor? do I just attach a zip file to a comment?

 

Viktor Tachev
Telerik team
commented on 18 Dec 2025, 12:57 PM

Yes, you can archive the project and send it as attachment. In case the archive is too big you can remove the bin and obj folders from it to decrease the size of the project.

That said, I have created a sample project with the latest version of the components and the editors are appearing as expected on my end. The data type is configured via attributes in the Model and the Views responsible for each DataType are placed in the ~/Veiws/Shared/EditorTemplates folder.

Give the attached project a try and let me know how it works for you. In case I am missing something, please modify the sample and send it back.

Lawrence
Top achievements
Rank 1
commented on 19 Dec 2025, 09:04 AM

Ok, your sample actually works on my machine, even copypasting the REPL code in my first link works in the project.

I've attached a simple project sample generated from my visual studio, with the REPL code and it doesn't work.

Is there's something wrong with my local install of either Progress Control Panel or Progress Telerik UI for ASP.NET Core Extension during project generation?

Can you check my attached project and point out what's preventing it from rendering the DateTime control?

Viktor Tachev
Telerik team
commented on 19 Dec 2025, 12:03 PM

Thank you for sharing a runnable sample example.

It appears the example provided has CSP enabled.  Because of this, the editor template will need to be configured as a CSP compatible template. This can be done using the UI for ASP.NET Core Template component.

The updated DateTime.cshtml would look like this:

@model DateTime?

@Html.Kendo().Template().AddComponent(x => x.DateTimePickerFor(m => m).HtmlAttributes(new { title = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("") }))

You should also add the EditorTemplateComponentName setting to the Grid column so the editor is rendered correctly.

columns.Bound(p => p.Expiry).EditorTemplateComponentName("DateTime");

I am attaching the updated sample as reference. There were some other minor changes: 

- The height for the Grid is now defined via the Height property to avoid CSP-related error

- I moved the Model to a separate file and bound the Grid using the DataSource.

If you would like more information on configuring Grid editing you would find the following article interesting:

https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/data-management/grid/editing/overview

 

Lawrence
Top achievements
Rank 1
commented on 23 Dec 2025, 04:30 AM

Ok thank you, that fixed it for me.
Tags
DateInput Grid
Asked by
Lawrence
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or