Hi Emrah,
Thanks for contacting Syncfusion support.
We have analyzed your query. We can override the default MVC editor templates and can render the EJ DatePicker control in EditorTemplates folder by EditorFor control in any view. In the model we can use DateAnnotations link UIHint and DataType attributes to state the template formats to use.
myModel.cs
using System.ComponentModel.DataAnnotations;
public class MyViewModel
{
[UIHint("WorkAround")]
public DateTime Patched { get; set; }
} |
The editorFor control uses the model and goes to partialView WorkAround.cshtml and renders DatePicker.
Index.cshtml
@model IDErrorSample.Models.MyViewModel
@{
ViewBag.Title = "Show Bug";
}
@Html.EditorFor(model => model.Patched)
|
WorkAround.cshtml
@model DateTime
@{
var id = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldId("");
}
<dl>
<dd>@Html.EJ().DatePickerFor(m=>m, new Dictionary<string, object> { { "id", id } }).DateFormat("dd/MMM/yyyy")</dd>
</dl>
|
For your convenience, we have prepared a work around sample to meet your requirement. Please, find the sample in the below link.
Also, use the below links to know more about the sample.
Please, let us know for any further assistance.
Regards,
Shameer Ali Baig S.