DatePickerFor not working with Model Binding

1 Answer 132 Views
Date/Time Pickers
Emma
Top achievements
Rank 1
Emma asked on 18 Nov 2024, 09:30 AM | edited on 19 Nov 2024, 07:57 AM

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

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 20 Nov 2024, 09:38 AM

Hi Emma,

Thank you for reaching out.

We already aware of the reported issue and as a consequence we have added the following feedback items that you can examine further:

I am happy to let you know that the issue has been fixed and it will be available in our next upcoming release.

I hope this clears things out, thank you for reporting this as well. It is good to have this information shared on a more public level.

Kind Regards,
Alexander
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.

Tags
Date/Time Pickers
Asked by
Emma
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or