I cannot find a way to make this work and hoping someone has an idea. A simplified example would be having a list of say integers 1-100, i want to group every 3 rows so the
How about a simpler approach:
var index = 0;
var grpOf3s = students.GroupBy(x => index++ / 3);
Update:
If you are using the Key value of the group item then you will need to convert the group enumerable to a list. Otherwise you will get a different Key every time it is accessed.
var index = 0;
var grpOf3s = students.GroupBy(x => index++ / 3).ToList();