After hours of searching in google and trying different syntaxis I decided to post this. The problem is I can\'t get the right way to use a DropDownList inside a webgrid. Co
Try the following format:
grid.Column(
"TodosLosRoles",
"Roles",
format: item => Html.DropDownList(((int)item.UserId).ToString(), Model[0].TodosLosRoles)
)
It's kinda crap, but WebGrid
is crap in general. It relies on weak dynamic typing, you can forget about strong typing and proper view model if you rely on this component. Prepare to cast as hell and for potential runtime errors if you are not extremely careful about the types you are passing.