This question is locked. New answers and comments are not allowed.
In my grid, I am updating the text color of a row based on a value. The grid uses ajax(Select) binding and looses the background style when an ajax call is made.
How do I maintain the style of the row when ajax binding occurs?
How do I maintain the style of the row when ajax binding occurs?
Html.Telerik().Grid(Model.MessageGridViewModelCollection) .Name("Messages") .DataBinding(dataBinding => { dataBinding.Ajax().Select(Model.AjaxAction, Model.AjaxController, Model.AjaxParameters).Enabled(true); }) .Columns(c => { c.Bound(o => o.LevelName); c.Bound(o => o.Message); c.Bound(o => o.EntityName); }) .RowAction(row => { string backgroundcolor = "black"; if (row.DataItem.LevelName == Level.Required) { backgroundcolor = "#CC0033"; } else if (row.DataItem.LevelName == Level.Warning) { backgroundcolor = "#D75D00"; } row.HtmlAttributes["style"] = "color: " + backgroundcolor; }) .Sortable() .Resizable(p => p.Columns(true)) .Filterable(f => f.Enabled(true)) .Pageable( f => f.PageSize(15)) .Render();