This article will help you to understand what is the use of datakeynames property of grid view.
In our scenario a row in a grid is uniquely identify by a combination of classid and studentid.
To understand this first declare data key name property with these two key name. As shown below:
Now on row command we will get the datakeynames value to identify the row uniquely that was clicked or which is the source of the rowcommand event.
To get the datakeyname value please try to understand following line:
now you can make updation to this student based on classid and studentid combination.