These parameters (and this constructor in general) really rarely need to be used. They are for creating a GridView, and it's rows, completely manually - something that's pretty unnecessary, considering the powerful databinding functionality that's built in to this control. Let me explain.
Generally, you should construct a datasource (DataTable, some generic list of a custom class, etc) and then assign that datasource to the GridView and bind it. This automates things like setting the RowIndex and DataItemIndex. It also allows for a number of other convenient features (sorting, paging, editing / deleting). See the GridView Web Server Control Overview
for a great breakdown of this default functionality.
Thus, I would say that you should add the new row to your datasource (whatever that may be), then set the updated datasource to your GridView's DataSource property, and call GridView.DataBind()
. You'll have your new row, and won't have to mess with creating GridViewRow objects manually.
But, to answer your question:
int rowIndex
: The index (position) the row you're creating will occupy in the GridView.
int dataItemIndex
: The index of the of this data in your underlying data source (the DataTable or generic list or whatever it is your using).
DataControlRowType rowType
: This is the type of row - a row with data, a header, a footer, etc (full list here).
DataControlRowState rowState
: The "state" the row is in - edit mode, read only mode, etc (full list here).