Hello Tyler,
The cause for the error is how the C# captures scope variable. In the code you have pasted, the c variable value is incremented thus all of the expression used in the column Bound method will point to the last value of the c. In order to correct this you should use a local variable which will hold the exact value of the c at the point of creation of the Bound method. Similar to the following:
for
(int c = 0; c < ViewBag.RoleCount; c++)
{
var
idx = c;
columns.Bound(r => r.Roles[idx].RoleVal).Title(ViewBag.Roles[c]);
}
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!