As they ask you to do it at run time, you need to add the controls to the control collection of the cell of the footer row of the gridView.
Button myBtn = new Button();
gvTest.FooterRow.Cells[1].Controls.Add(myBtn);
Play caution where the dynamic addition is done if you want it to persist.