Preface: I did not come up with this implementation, just dealing with it.
I have a web part zone that gets 3 content editor web parts loaded into it dynamically through the feature receiver. The content parts are created on the page, exported to XML, the XML exports are added to the VS project, and then deleted from the page to be added through the receiver to an aspx page with zones defined. An SPLimitedWebPartManager is used in the FeatureActivated event and calls AddWebPart() for each content part to be added (the XML files).
The problem is the order that they are displayed on the page. The sequence of adding them in the receiver is correct, and the only order property I can discern in the XML is PartOrder which are currently set to 1,2, and 10. They should display in that order but the second one is always last on the final page.
I've tried deleting/recreating the site collection and they still always appear in the wrong order.
Any idea on how to get them to be added to the page in the proper order?
Thanks.