Is there a way to conditionally format a cell in a Kendo UI cell depending on the value in that cell. I would also like to add a class to the grid cell depending on the value. ( ASP.net , C# , Razor )
PS
Decision
And I realized that.
<script> function onDataBound(e) { $('td').each(function() { if ($(this).text() == 'Condition') { $(this).addClass('customClass'); } }); } </script>
The grid looks like this:
@(Html.Kendo().Grid<CustomStylesOnDataBound.ViewModels.EmployeeViewModel>() .Name("mvcGrid") .Columns(columns => { columns.Bound(p => p.EmployeeId).Width(100); columns.Bound(p => p.FirstName).Width(75); columns.Bound(p => p.LastName).Width(75); columns.Bound(p => p.Address); }) .Events(e => e.DataBound("onDataBound")) .Filterable() .Pageable() .DataSource(dataSource => dataSource .Ajax() .PageSize(50) .Read(read => read.Action("Employees_Read", "Home")) ) )
I'm not sure if there is a better solution for this, but it does its job. Ty peter
source share