...
productsGrid.Bind(EventType.OnRowTransform, "highlightOrderLevels");
...
<script type="text/javascript">
function highlightOrderLevels(sender, args)
{
var unitsInStock = parseInt(sender.columnValue("UnitsInStock",args.row));
var reorderLevel = parseInt(sender.columnValue("ReorderLevel",args.row));
if (unitsInStock < reorderLevel) {
$(args.row).css("backgroundColor", "#F2D7D5").css("color", "#CD6155");
$(args.row.cells[sender.columnIndex("UnitsInStock")]).css("backgroundColor", "#CD6155").css("color", "#F2D7D5");
$(args.row.cells[sender.columnIndex("ReorderLevel")]).css("backgroundColor", "#CD6155").css("color", "#F2D7D5");
}
}
</script>
|