Hi I have a column in my grid that is a DateTime field with long format date e.g. Friday, May 10, 2013
This is how it is defined in the ViewModel
The column is displayed correctly with what I want e.g. Friday, May 10, 2013 but when I get the selected row data for that column it is coming back with the following:
Here is the code on the view to get the selected row.
How do I change it to get the long format date that is displayed in the grid? Any help greatly appreciated.
This is how it is defined in the ViewModel
[Required]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:D}")]
[Display(Name = "Visit Date")]
public DateTime VisitDate { get; set; }
[17:39:18.580] VisitDate: Fri May 10 2013 00:00:00 GMT-0400 (Eastern Daylight Time)
function deleteRow() {
var grid = $('#scheduleGrid').data('kendoGrid');
var rows = grid.select();
if (rows.length > 0) {
var dataItem = grid.dataItem(rows);
console.log("VisitDate: " + dataItem.VisitDate);
}
}
How do I change it to get the long format date that is displayed in the grid? Any help greatly appreciated.