Home / DeveloperSection / Forums / Sorting by date in Webgrid MVC

Sorting by date in Webgrid MVC

Anonymous User 1460 23-Apr-2018

I want to show record by date wise what is the code to do sorting by date


    var grid = new WebGrid(canSort: true, canPage: true, rowsPerPage: 10);
    grid.Bind(Model, autoSortAndPage: false, rowCount: Convert.ToInt32(ViewBag.TotalPost));

        @grid.Table(tableStyle: "table table-striped",
                                      columns: grid.Columns(
                                     grid.Column("Title", format: @<text>@item.Title</text>),
                                       grid.Column("Date", format: @<text>@item.Date</text>),

Updated on 24-Apr-2018
I am a content writter !

Can you answer this question?


1 Answers

Liked By