I want to archive the records as per the months. Suppose the current month is June, so i would like to show the records created in this month in grid view. But the older records would be chronologically available in the archive column with each passing month.
What I have tried:
I have created a view that shows current months record in gridviiew. but i am unable to develop the archive column with previous month records.
my grid view
<div class="row">
<table style="width:100%">
<tr>
<td style="color: white; font-size: 26px; height: 10%; font-size:large" colspan="5" bgcolor="#B40404" align="center">@ViewBag.month</td>
</tr>
</table>
</div>
@{
WebGrid grid = new WebGrid(null, rowsPerPage: @Model.PageSize, canPage: true);
grid.Bind(Model.ListAuthGrid, autoSortAndPage: true, rowCount: @Model.PageSize);
grid.Pager(WebGridPagerModes.NextPrevious);
}
@grid.GetHtml(tableStyle: "table table-bordered table-striped", headerStyle: "bg-success", selectedRowStyle: "bg-warning", footerStyle: "bg-warning",
mode: WebGridPagerModes.All,
firstText: "<< First",
previousText: "< Prev",
nextText: "Next >",
lastText: "Last >>",
columns: grid.Columns(
grid.Column("", "",
format: @<text><center><img src="@Url.Content(item.filename)" width='120px' height='120px' /></center></text>),
grid.Column("exemsg", "Message to All"),
grid.Column("exeexp", "Experience in OIL"),
grid.Column("exelearn", "What I Learnt"))