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.SortMode(GridSortMode.MultipleColumn))
    .Resizable(e => e.Columns(true))
    .Filterable(f => f.Extra(false)
        .Operators(o => o.ForString(str => str.Clear()
                .StartsWith("Starts with")
                .EndsWith("Ends with")
                .Contains("Contains")
                .DoesNotContain("Not contains")
            )
        )
    )
)

Thank you!



ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

Format DateTime in Kendo UI Grid using ASP.Net MVC Wrapper Format DateTime in Kendo UI Grid using ASP.Net MVC Wrapper Reviewed by Anil Singh on 10:00 PM Rating: (5)
www.code-sample.com/. Powered by Blogger.
^