Hi,
The error is telling you that you cannot cast System.Web.UI.WebControls.GridViewRow to System.Windows.Forms.DataGridViewRow.
In simple words casting green apples to red apples, although they are apple, but different in some context.
use your foreach loop to use System.Web.UI.WebControls.GridViewRow as your GridViewAllAssigments is System.Web.UI.WebControls.GridView.
foreach(System.Web.UI.WebControls.GridViewRow gvRowAssigment in GridViewAllAssigments.Rows)
I hope this helps.
Regards
Jegan