<p>I'm adding a new field to a list and view. To add the field to the view, I'm using this code:</p>

<pre><code>view.ViewFields.Add("My New Field");
</code></pre>

<p>However this just tacks it on to the end of the view. How do I add the field to a particular column, or rearrange the field order? view.ViewFields is an SPViewFieldCollection object that inherits from SPBaseCollection and there are no Insert / Reverse / Sort / RemoveAt methods available.</p>

I've found removing all items from the list and readding them in the order that I'd like works well (although a little drastic). Here is the code I'm using:
```
```
string[] fieldNames = new string[] { "Title", "My New Field", "Modified", "Created" };
SPViewFieldCollection viewFields = view.ViewFields;
viewFields.DeleteAll();
foreach (string fieldName in fieldNames)
{
    viewFields.Add(fieldName);
}
view.Update();
```
```