It would appear that attempting to use a RowAction (to highlight certain rows) is not working in a grid that uses Ajax binding. I need to use Ajax binding because of the virtual scrolling.
Code:
@(Html.Kendo().Grid(Model.userMasterList)
.Name("userMasterGrid")
.Columns(col =>
{
col.Bound(c => c.userName);
col.Bound(c => c.securityLevel);
col.Bound(c => c.name);
col.Bound(c => c.sifEmailInd).ClientTemplate("<input type='checkbox' #= sifEmailInd ? 'checked=checked': '' # disabled='disabled' ></input>");
col.Bound(c => c.activeInd).ClientTemplate("<input type='checkbox' #= activeInd ? 'checked=checked': '' # disabled='disabled' ></input>");
col.Bound(c => c.lastLoginDate);
col.Bound(c => c.lastUpdatedDate);
col.Bound(c => c.userId);
col.Bound(c => c.leaNumber).Hidden(true);
}
)
.Scrollable(scrollable => scrollable.Virtual(true))
.Sortable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.HtmlAttributes(new { style = "height:350px;" })
.Events(events => events.Change("onChange"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("UserMaster", "Account"))
.Model(model => model.Id(i => i.userId))
)
.RowAction(row =>
{
if (!row.DataItem.activeInd)
{
row.HtmlAttributes["class"] = "inactiveUser";
}
}
)
)
Any help would be appreciated
Robert
Code:
@(Html.Kendo().Grid(Model.userMasterList)
.Name("userMasterGrid")
.Columns(col =>
{
col.Bound(c => c.userName);
col.Bound(c => c.securityLevel);
col.Bound(c => c.name);
col.Bound(c => c.sifEmailInd).ClientTemplate("<input type='checkbox' #= sifEmailInd ? 'checked=checked': '' # disabled='disabled' ></input>");
col.Bound(c => c.activeInd).ClientTemplate("<input type='checkbox' #= activeInd ? 'checked=checked': '' # disabled='disabled' ></input>");
col.Bound(c => c.lastLoginDate);
col.Bound(c => c.lastUpdatedDate);
col.Bound(c => c.userId);
col.Bound(c => c.leaNumber).Hidden(true);
}
)
.Scrollable(scrollable => scrollable.Virtual(true))
.Sortable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
.HtmlAttributes(new { style = "height:350px;" })
.Events(events => events.Change("onChange"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("UserMaster", "Account"))
.Model(model => model.Id(i => i.userId))
)
.RowAction(row =>
{
if (!row.DataItem.activeInd)
{
row.HtmlAttributes["class"] = "inactiveUser";
}
}
)
)
Any help would be appreciated
Robert