I am creating groups of students .I have a Gridview in c# asp.net.It contain one item template field label.I have one dropdownlist from which i am selecting no. of groups i want to made.I want to apply loop on the gridview in such a way that when I select any integer value from dropdownlist the the item template field label get value as....example If I select 3 from dropdownlist then loop work as it first assign value to top 3 students and then move to last of gridview and assign value from bottom to top 3 STUDENTS and again move from top and so on......
name groupno.
A 1
B 2
C 3
D 1
E 2
F 3
G 1
H 3
I 2
J 1
K 3
L 2
M 1
Please help me.