You can find a lot of code samples for this on line - here's one sample.
However, I would not assume that the insertion of the rows is causing your performance issue, nor would I assume that code will cause this to execute more quickly. It seems more likely that the issue is caused by the form rendering more slowly as the rows are added. Is your form posting back each time you add a row using the built in functionality? That is, do you get the "sending data to the server" message?