This question is locked. New answers and comments are not allowed.
Dear support team,
the code below is to set the background color of a column using CellAction function. it works fine without DataBinding, but the style will get lost on paging and sorting when DataBinding is inserted. Any idea? Thanks.
the code below is to set the background color of a column using CellAction function. it works fine without DataBinding, but the style will get lost on paging and sorting when DataBinding is inserted. Any idea? Thanks.
@{ //set consts const string colNameStyled = "ColName"; //render grid Html.Telerik().Grid(Model).Name("Grid") .Columns(columns => { ... columns.Bound(...).Title(colNameStyled)...; ... }) .DataBinding(dataBinding => { dataBinding.Server().Select("Index", ...); dataBinding.Ajax().Select("_AjaxIndex", ...); }) .CellAction(cell => { if (cell.Column.Title == colNameStyled) { cell.HtmlAttributes["style"] = "background-color: green;"; } }) .Sortable() .Pageable() .Render();}