[DevExpress Support Team: CLONED FROM S173664: How to refresh View appearance after making changes to the Application Model in code]
2. Problem – start ListView “Test Bo 2” and execute action “SwitchEditor”… OK, the problem is understandable, but what to do with it? Now we avoid this problem, because we set DataAccessMode = Client to the View.Model during View recreating if the editor does not support server mode. In case with Frame.SetView(…) without View recreating it does not work, because the collection source of the View is already created. I didn’t find any solution for this scenario, but just forbid the action if desired editor can’t work in server mode is not the appropriate solution for us.
How to switch between TreeListEditor and GridListEditor in a ListView with DataAccessMode = Server and avoid InvalidOperationException (X does not support Server Mode)
Answers approved by DevExpress Support
Hello,
If a list editor does not support server mode, it is a developer's responsibility to configure the ListView the way it will not cause this exception or avoid this situation at all, e.g., by disabling a corresponding UI command and providing a meaningful tooltip for it.
Alternatively, you can consider using our ViewVariants module instead of implementing a custom-tailored solution. I have modified your sample to demonstrate this solution.