We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Editor Templates with Syncfusion Controls

Thread ID:





130816 Jun 5,2017 12:08 PM UTC Jun 12,2017 12:29 PM UTC ASP.NET MVC 4
Tags: DatePicker
Asked On June 5, 2017 12:08 PM UTC

I want to override default MVC editor templates (~/Shared/EditorTemplates/). when I add a new view named Date include Syncfusion DatePickerFor, it doesn't work, if I only use DatePicker in this view it works but can't handle when editing. 
What can I do?

Shameer Ali Baig Sulaiman Ali Baig [Syncfusion]
Replied On June 6, 2017 12:39 PM UTC

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. 
using System.ComponentModel.DataAnnotations; 
public class MyViewModel 
        public DateTime Patched { get; set; } 

The editorFor control uses the model and goes to partialView WorkAround.cshtml and renders DatePicker. 
@model IDErrorSample.Models.MyViewModel 
    ViewBag.Title = "Show Bug"; 
@Html.EditorFor(model => model.Patched) 

@model DateTime 
    var id = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldId("");  
    <dd>@Html.EJ().DatePickerFor(m=>m, new Dictionary<string, object> { { "id", id } }).DateFormat("dd/MMM/yyyy")</dd> 
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. 
Shameer Ali Baig S. 

Shameer Ali Baig Sulaiman Ali Baig [Syncfusion]
Replied On June 6, 2017 12:51 PM UTC

Hi Emrah, 
Sorry, we missed to update the sample in previous update. 
Please, find the sample for editor templates using EJ DatePicker in the below link. 
Sample: Editor Templates  
Shameer Ali Baig S. 

Replied On June 9, 2017 06:11 AM UTC

Thank you so much,

Shameer Ali Baig Sulaiman Ali Baig [Syncfusion]
Replied On June 12, 2017 12:29 PM UTC

Hi Emrah, 
Most Welcome. 
Please let us know, if you need any further assistance. 
Shameer Ali Baig S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon