I have one datagridview and defined one custom pop up editor.
Please note that i have tried to apply datetime format to DOB (which is datetime field defined in Model) but it does not work. It still return data as
"Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)"
I have set the annotation [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm}")] in the Model but it only displayed correctly in gridview column, when i double click and bring out the pop up editor, the date time format still show as "Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)".
The editor content as below:
"
@model Application.Models.CustomerModel
<table class="popup-layout-tbl" style="display: table;">
<tbody>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.CustomerID, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.CustomerID, new { @readonly = true, @class = "popup-input" })
@Html.ValidationMessageFor(model => model.CustomerID)
</div>
</td>
</tr>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.CustomerName, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.CustomerName, new { @class = "popup-input" })
@Html.ValidationMessageFor(model => model.CustomerName)
</div>
</td>
</tr>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.DOB, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.DOB, "{0:MM/dd/yyyy}", new { @readonly = true, @class = "popup-input" })
@Html.ValidationMessageFor(model => model.DOB)
</div>
</td>
</tr>
</tbody>
</table>
"
Please note that i have tried to apply datetime format to DOB (which is datetime field defined in Model) but it does not work. It still return data as
"Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)"
I have set the annotation [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm}")] in the Model but it only displayed correctly in gridview column, when i double click and bring out the pop up editor, the date time format still show as "Mon Apr 18 2016 10:52:37 GMT+0800 (Malay Peninsula Standard Time)".
The editor content as below:
"
@model Application.Models.CustomerModel
<table class="popup-layout-tbl" style="display: table;">
<tbody>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.CustomerID, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.CustomerID, new { @readonly = true, @class = "popup-input" })
@Html.ValidationMessageFor(model => model.CustomerID)
</div>
</td>
</tr>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.CustomerName, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.CustomerName, new { @class = "popup-input" })
@Html.ValidationMessageFor(model => model.CustomerName)
</div>
</td>
</tr>
<tr>
<td>
<div class="k-edit-label popup-label">
@Html.LabelFor(model => model.DOB, new { @class = "popup-label-text" } )
</div>
<div>
@Html.TextBoxFor(model => model.DOB, "{0:MM/dd/yyyy}", new { @readonly = true, @class = "popup-input" })
@Html.ValidationMessageFor(model => model.DOB)
</div>
</td>
</tr>
</tbody>
</table>
"