I am creating a web part for SharePoint. I have a custom editor part that overrides the SyncChanges () and ApplyChanges () methods (among others).
The problem is that when I click OK in edit mode, the page switches to view mode, but the data (propeties) that were changed in the editor and saved in the ApplyChanges () method are not updated. I have to go back to the page (reload without POSTing data) to see the change.
I debugged it and figured out what it was doing - after clicking OK in edit mode, WebPart.CreateChildControls () was called first, and EditorPart.ApplyChanges () was called the second. Thus, the data was updated, but not updated data was displayed.
I realized something else in this behavior: adding one specific control to my WebPart in CreateChildControls () causes the wrong order of calling WebPart.CreateChildControls () and EditorPart.ApplyChanges (). In my case, this causes the WebDataTree or UltraWebTree controls (from Infragistics) to be added, but this can also happen with a regular ASP.NET text block (as described here for the same problem in more detail: ASP.net forum topic ).
So, if I add a tree, CreateChildControls () is called first, and ApplyChanges is called second, so this is not relevant. I have to update to see the changes made to the editor part.
If I comment on adding a tree to the collection of controls, ApplyChanges is called first, and everything is fine (except that I need this tree :)) ...
Does anyone know what might cause this strange behavior?
Petr
source share