Bug Report T601207
Visible to All Users

View Variants Module - ListView variant always takes the DataAccessMode value from the root node instead of own model differences, which may cause an exception due to an incompatible ListEditor type

created 7 years ago

Hello,

We ran into an issue where the View Variants Module does not take different Data Access Modes into consideration between views. As the documentation states:

Each View Variant can have an individual IModelListView.DataAccessMode value (see List View Data Access Modes Overview), but this value is ignored. Instead, the value specified for the root varied View is used for all variants.

In most cases this makes sense, however, if the variant view's List Editor does not support the data access mode, the collection should be recreated using the new mode. Alternatively, before switching the view, a check should be done to ensure the new editor supports the root data mode and throw a friendly exception if it does not - and prevent the view from being changed.

In our scenario, we have a large list of calendar items that can be displayed in a GridListEditor with reasonable loading time in Server Mode. However, the variant for the SchedulerListEditor needs to load in Client Mode. When switching between these variants, an exception occurs and the user is stuck.

While we can do this ourselves with a controller, I'm making the suggestion to provide this capability out of the box.

Thanks!
-Dave

Comments (2)
DevExpress Support Team 7 years ago

    Thank you for contacting us regarding this scenario. We need additional time to research and discuss it. Please bear with us. We will update this ticket once we have any results.

    DevExpress Support Team 7 years ago

      We investigated how to manage this configuration better and will see how to improve our code, though I cannot promise any time frame. Nevertheless, thank you for your feedback. I greatly appreciate your cooperation.

      Answers approved by DevExpress Support

      created 7 years ago (modified 7 years ago)

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Additional information:

      Hello Dave,

      We found a relatively simple and reliable way to implement the behavior you wanted without breaking existing code. Would you please test the DevExpressNETComponents-17.2.exe build where these changes are incorporated? Consider using the attached sample and executing the Change View Variant Action. With the provided build, the Event_ListView variant should respect its own DataAccessMode value (Client) despite the root's one (Server):

      We are looking forward to hearing from you to see if everything works as you expect now.

      Thanks,
      Dennis

        Show previous comments (1)
        Dennis Garavsky (DevExpress) 7 years ago

          Thanks for testing, Dave!

          DP DP
          Darko Prenosil 7 years ago

            Confirmed. Removed my custom controllers for switching the views, and tried on a huge GridView/TreeView  variants.
            It is working as expected.

            Thanks !

            Dennis Garavsky (DevExpress) 7 years ago

              @Darko: Thanks for testing!

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.