Logic can be as follows...
1. On Load button click, Loop through all the rows of DataGridView using
foreach
statement like below...
For Each row, inside the loop do the following.
2. Find the Total column value for the row.
3. Apply logic "Total/No._Of_Faculties" and find the result.
4. Find all the Columns related to Faculties and assign this value to them.
For looping code will look like below.
foreach(DataGridViewRow row in dgvCourses.Rows)
{
}
Update
Code may be like below.
int totalHours = 0;
int facultyHour = 0;
foreach(DataGridViewRow row in dgvCourses.Rows)
{
totalHours = Convert.ToInt32(row.Cells["total"].Value);
facultyHour = totalHours / 5 ;
row.Cells["GS"].Value = facultyHour.ToString();
row.Cells["VB"].Value = facultyHour.ToString();
row.Cells["SJ"].Value = facultyHour.ToString();
row.Cells["RK"].Value = facultyHour.ToString();
row.Cells["MS"].Value = facultyHour.ToString();
}
NOTE
Replace the Cell names in the code correctly.
I have not tested this code. So, just debug and see what is happening. But follow this logic.