@(Html.EJ().Grid<MvcApplication122.Models.Order>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .AllowPaging() . . . . . .ClientSideEvents(eve=>eve.QueryCellInfo("querycellinfo")) ) <script> function querycellinfo(args) { if (args.column.field == "OrderID" && args.data.OrderID >= 10251 && args.data.OrderID <= 10260) $($(args.cell).parent()).css("backgroundColor", "blue");/*custom css applied to the row */ if (args.column.field == "OrderID" && args.data.OrderID >= 10261 && args.data.OrderID <= 10270) $($(args.cell).parent()).css("backgroundColor", "white");/*custom css applied to the row */ if (args.column.field == "OrderID" && args.data.OrderID > 10270) $($(args.cell).parent()).css("backgroundColor", "gray");/*custom css applied to the row */ } |
How would you use the colours from the Bootstrap CSS. Succes, etc.... ?
Hi is this possible to achieve with .NET Core 2?
Edit: Nevermind, I figured it out using rowDataBound as described here: https://www.syncfusion.com/forums/132334/change-background-colour-of-a-row-based-on-value-of-a-field
:)
Thanks