SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The list has column a,b,f

I want to add some columns to the list and to the view. but in a defined order. I want column country and organization to be BETWEEN columns b and F

Is it possible?

SPList accessList = newSiteCollection.RootWeb.Lists.TryGetList("Workspace Access Rights");
                    if (accessList != null)
                        SPFieldCollection collFields = accessList.Fields;
                        collFields.Add("Country", SPFieldType.Text,false);
                        collFields.Add("Organisation", SPFieldType.Text, false);
                        collFields.Add("samAccountName", SPFieldType.Text, false);
                        SPView view = accessList.Views["All Items"];
share|improve this question
up vote 3 down vote accepted

Just remove all the fields and re-add them again.

share|improve this answer

Only in SharePoint does a private implementation detail of a class, namely of the order in which the fields in this "collection" are stored, have observable effects.

If designed correctly, it would be an SPFieldList that was indexable, and thus explicit that the order mattered. I wish MS would get some decent developers to work on SharePoint.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.