Skip to main content

Posts

Showing posts with the label Format DateTime in Kendo UI Grid using ASP.Net MVC Wrapper

Format DateTime in Kendo UI Grid using ASP.Net MVC Wrapper

Hello everyone, I am going to share the code sample for custom DateTime  format in Kendo UI Grid template using ASP.Net MVC .  The code detail as given below. @( Html.Kendo().Grid<Model. Users >()     .Name( "GridName" )     .Columns(columns =>     {         columns.Bound(p => p.ID).Title( "ID" );         columns.Bound(p => p.CREATE_DATE).Title( "DATE" ) .ClientTemplate( "#= kendo.toString(kendo.parseDate(CREATE_DATE), 'dd/MM/yyyy') #" );     })     .DataSource(ds => ds         .Ajax()         .Read(read => read.Action( "ActionName" , "ControllerName" ))         .PageSize(PageSize)     )     .Pageable()     .Sortable(s => s.Sort...

Format DateTime in Kendo UI Grid using ASP.Net MVC Wrapper

columns.Bound(p => p.CreatedDate). ClientTemplate ( "#= kendo.toString(kendo.parseDate(CreatedDate), 'dd-MM-yyyy hh:mm tt') #" ); OR template = #: kendo.toString(CreatedDate, ' dd-MM-yyyy hh:mm tt ') OR columns.Bound(p => p.CreatedDate).Title( "Created Date" ).Format( "{0:" + System.Globalization. CultureInfo .CurrentCulture. DateTimeFormat .ShortDatePattern + "}" ); OR columns.Bound(p => p.CreatedDate).Title( "CreatedDate" ).Format( "{0: dd-MM-yyyy hh:mm tt }" ) ;