I am working with a custom list I've built in SharePoint. I have a feature which has an event handler that kicks off when the feature is activated. That event handler calls (I can debug and watch it execute) the following function:
I'm intending that the function behaves as described here.
private void OrderFields(SPWeb web)
{
// This works fine: I get the expected SPContentType object
// There is only 1 SPContentType in ContentTypes
SPContentType contentType = web.Lists[TASK_LIST_NAME].ContentTypes[0];
contentType.FieldLinks.Reorder(new string[4]
{
"Field1",
"Field2",
"Field3",
"Field4"
});
contentType.Update();
}
The function that calls OrderFields
calls web.Update();
as well.
Unfortunately, the reorder call does not reorder my fields on my form. Am I missing something? Can anyone suggest any tricks I might try?