I'm attempting to style an MVC kendo grid based on values in the underlying datasource. I have a mechanism that seems to work, but certain style elements (notably borders) do not seem to accept the new style class, whereas other elements (row background color) work fine.
Grid:
@(Html.Kendo().Grid(Of RTFVM)().Name("RealTimeFinancials") _
.Events(Function(x) x.DataBound("LineItems_Databound")) _
.Columns(Sub(c)
c.Bound(Function(x) x.Line.LineItem).HtmlAttributes(New With {.style = "text-align:left"})
etc
Event handler:
function LineItems_Databound() {
var grid = $("#RealTimeFinancials").data("kendoGrid");
var data = grid.dataSource.data();
$.each(data, function (i, row) {
var LineItem = row.Message;
switch(LineItem) {
case 'SubTotal': $('tr[data-uid="' + row.uid + '"]').css({ "border-style":"solid", "border-top":"single","background-color":"yellow"}); break;
case 'Total': $('tr[data-uid="' + row.uid + '"]').addClass('customClass'); break;
case 'GrandTotal': $('tr[data-uid="' + row.uid + '"]').css({ "border-style":"solid", "border-bottom":"double"}); break;
}
});
}
CSS Class:
.customClass {
border-top-style:double;
border-style:double;
border-top-width:thick;
background-color:lightyellow;
}
Neither the .css or the .addClass have any effect on the row border style, whilst both happily change the background color of the row.
Is it that I need to do this at a cell-level? But that seems odd given the background color works row-wise.