Hi Support Team,
I upgrade my project from .Net 8.0 Telerik 2024 Q3 to .Net 9.0 Telerik 2024 Q4
I have an issue with DatePickerFor. Currently DatePickerFor data not showing when using model binding with DateTime? (allow null).
Note: This issue was working with Telerik 2024 Q3.
I create simple ASP.NET MVC Core project:
+ TestDateVM view model:
public class TestDateVM
{
public DateTime? Date { get; set; }
}
+ HomeController.cs : I set value Date for view model = 01 Nov 2024
public class HomeController : Controller
{
public IActionResult Index()
{
var filter = new TestDateVM();
filter.Date = new DateTime(2024, 11, 1);
return View(filter);
}
}
+ Index.cshtml
@model TestDateVM
@{
ViewData["Title"] = "Home Page";
}
<div class="row">
Date
<div class="col-sm-3 form-group">
@{
Html.Kendo().DatePickerFor(s => s.Date).Format("dd MMM yyyy")
.HtmlAttributes(new { id = Guid.NewGuid().ToString() }).Render();
}
</div></div>
When run project, DatePicker not show data of model binding. DatePicker should show value = 01 Nov 2024. Please help me how DatePickerFor work with Model Binding with new Telerik version 2024 Q4
Below is a result picture when I run simple project above.
Thanks