Hello!
I have a grid in which I need to display if my record is active or not. I have an expiration date (dateTo field) which I need to compare it with dateTime now. If the dateTo is earlier than today then an image is not be displayed. Lets say "active image" if not then to display the "no active image".
Is that possible?
thank you!
@(Html.Kendo().Grid<ElkeSite.Models.Records>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.ID).Hidden();
columns.Bound(c => c.Title);
columns.Bound(c => c.DateTo).Filterable();
columns.Bound(?);
})
.HtmlAttributes(new { style = "height: 600px;" })
.Scrollable()
.Sortable()
.Filterable()
.Groupable()
.Sortable()
.Pageable(pageable => pageable
.Refresh(true)
PageSizes(true)
.ButtonCount(5)
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Read", "Records"))
.PageSize(10)).NoRecords(x => x.Template("<div class='empty-grid'></div>"))
.ToolBar(toolbar =>
{
//toolbar.Excel();
//toolbar.Pdf();
})
)
I found out a solution which help me to solve my issue. Thank you
https://stackoverflow.com/questions/50281716/comparing-dates-in-kendo-html-grid-client-template
Hello Marina,
Thank you for sharing the solution you've found with the community. It will surely help someone who is working on a similar to your scenario.