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 Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.