c# - MVC Razor Grid Losing Checkbox on Paging -
maybe has more scripting in dynamic htmlattribute dictionary, have gridmvc object paging , can store checkstate of checkbox outside object, when page (let's 1 6, go 1, it's not saving state of checkbox.
i've got idea i'm trying working can't syntax correct yet.
any ideas?
<div> @html.grid(model.resulttable).columns(columns => { columns.add().encoded(false).sanitized(false).setwidth(30). rendervalueas(o => html.checkbox("checkrow" + model.resulttable.indexof(o), false, new { @onclick = "javascript:togglerowselect(" + model.resulttable.indexof(o) + ");", @(viewbag.selectedtxforreturn.tostring().contains(o.transaction_no.tostring()) ? "checked" : "")) })); //other columns redacted simplicity = work }).withpaging(10) </div>
so line that's causing error is:
@(viewbag.selectedtxforreturn.tostring().contains(o.transaction_no.tostring()) ? "checked" : ""))
and error is:
invalid anonymous type member declarator. anonymous type members must declared member assignment, simple name or member access.
Comments
Post a Comment