You don't state exactly where it fails, but I guess that this is the line that fails.
yourTasksGV.Controls[0].Controls.AddAt(2, gvrRow);
As you are using .AddAt, I suggest you check how many controls you have.
int controlCount = yourTasksGV.Controls[0].Controls.Count;
If the count = 2, you will get an error when you try access the third position.