I'm attempting to style the 'containing' cell in a kendo (mvc) grid. The column is bound as follows:
@(Html.Kendo().Grid(Of RTFVM)().Name("RealTimeFinancials") _
.Columns(Sub(c)
c.Bound(Function(x) x.Line.Months(0).Total).Title("Jan").ClientTemplate("#= processCell(Line.Months[0])#")
etc
And my JS conditional styling function is as follows:
function processCell(CellData) {
var monthNumber = CellData.MonthNumber;
var output;
switch(CellData.Message) {
case null: output = fn(CellData.Total); break;
case 'Total': output = '<div style="background-color: Red;"><strong>' + fn(CellData.Total) + '</strong></div>';
break;
default: output = '<small>' + CellData.Message + '</small>';
}
return output;
}
Using the above I can style the text that appears in the cell but apparently not the cell itself (I guess you could call it the text object's 'parent'/container).
Is there any way to access/style the cell from within the ClientTemplate or do I have to separately find the cell by using the databound event using the data-uid row/column-find method?