Hi,
I need to give a specific class to a row based on some condition, so i used following code to add class to that row
@(Html.Kendo().Grid((IEnumerable<model>))
.Name("ABCDSource")
.Columns(columns =>
{
columns.Bound(d => d.col).Title("col").
columns.Bound(d => d.col1).Title("col1");
columns.Bound(d => d.col2).Title("col2");
columns.Bound(d => d.col3).Title("col3");
})
.RowAction(row=>
{
row.HtmlAttributes.Add("style", "background:red;");
// "DataItem" is the Order object to which the current row is bound to
if (row.DataItem.Istrueval== true)
{
//Set the background of the entire row
row.HtmlAttributes["style"] = "background-color:blue";
row.HtmlAttributes["class"] = "deleted-row";
}
}).......
I have added these properties to the row
1.style and
2. class
but both attributes are not getting applied to that row. And rest of the code don't have any syntactical error.
Please could you suggest a solution?
I need to give a specific class to a row based on some condition, so i used following code to add class to that row
@(Html.Kendo().Grid((IEnumerable<model>))
.Name("ABCDSource")
.Columns(columns =>
{
columns.Bound(d => d.col).Title("col").
columns.Bound(d => d.col1).Title("col1");
columns.Bound(d => d.col2).Title("col2");
columns.Bound(d => d.col3).Title("col3");
})
.RowAction(row=>
{
row.HtmlAttributes.Add("style", "background:red;");
// "DataItem" is the Order object to which the current row is bound to
if (row.DataItem.Istrueval== true)
{
//Set the background of the entire row
row.HtmlAttributes["style"] = "background-color:blue";
row.HtmlAttributes["class"] = "deleted-row";
}
}).......
I have added these properties to the row
1.style and
2. class
but both attributes are not getting applied to that row. And rest of the code don't have any syntactical error.
Please could you suggest a solution?