This question is locked. New answers and comments are not allowed.
hello all,
i 'm using telerik MVC grid where i need to change the backgroung color of row for "VOLUMES" and "RA".
below code color our entire grid...
attached the grid...
i 'm using telerik MVC grid where i need to change the backgroung color of row for "VOLUMES" and "RA".
below code color our entire grid...
attached the grid...
@(Html.Telerik().Grid(Model.Data) .Name("Grid") .Columns(columns => { foreach (var column in Model.Data.Columns) { columns.Bound(column.ToString()).Encoded(false); } }) .RowAction(row => { if (row.DataItem.DataView[1].Row.ItemArray[0].ToString().ToLower() == "volumes") { //row.HtmlAttributes["style"] = "background:black;color:white;"; } }) .CellAction(cell => { if (cell.Column.Member != "Column1") { cell.HtmlAttributes["style"] = "text-align:center"; } if (cell.Column.Member == "Column1") { for (int i = 0; i < cell.DataItem.DataView.Count; i++) { for (int j = 0; j < cell.DataItem.DataView[0].Row.ItemArray.Count(); j++) { switch (cell.DataItem.DataView[i].Row[j].ToString().ToLower()) { case "retail analysis": cell.DataItem.DataView[i].Row[j] = "RA"; //cell.HtmlAttributes["style"] = "background:black;color:white;"; break; //case "volumes": // cell.DataItem.DataView[i].Row[j] = Html.LocalizeValue("lbl_RETAILANALYSIS"); // break; } } } } }) )