I have a datatable with one column:
this.callsTable.Columns.Add("Call", typeof(String));
I then want to add a row to that datatable, but want to give a specific index, the commented number is the desired index:
this.callsTable.Rows.Add("Legs"); //11
Update:
You can use DataTable.Rows.InsertAt
method.
DataRow dr = callsTable.NewRow(); //Create New Row
dr["Call"] = "Legs"; // Set Column Value
callsTable.Rows.InsertAt(dr, 11); // InsertAt specified position
See: DataRowCollection.InsertAt Method
If the value specified for the pos parameter is greater than the number of rows in the collection, the new row is added to the end.