Ticket Q474081
Visible to All Users

Refresh view is not working

created 12 years ago

Hello,

probably I am not referencing properly the View I must to refresh, I have tried with ObjectSpace Refresh, etc, but it looks I am doing something wrong.

I have added a PDF document when I describe clear what is the problem.

I highly appreciate your help.

Best Regards,

Gary

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Gary,
To refresh this particular nested ListView, you can find the corresponding ListView object, and call its ObjectSpace.Refresh or CollectionSource.Reload methods when you finished your main data manipulations. If this does not work, then you used a wrong ListView object.
To ensure that this is what you are looking for, please inspect its Id or Caption properties while debugging.
UPDATE:
To access a nested ListView, you can either 1) write a ViewController that will target this particular ListView OR 2) Use the DetailView.FindItem method to access the corresponding ListPropertyEditor and its ListView property. Here is some pseudo code for your reference:

C#
((ListPropertyEditor)theContactDetailView.FindItem("Tasks")).ListView.CollectionSource.Reload(); //OR ((ListPropertyEditor)theContactDetailView.FindItem("Tasks")).ListView.ObjectSpace.Refresh();

I hope you find this information helpful.
Let me know if I can assist you further.

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

      I am glad to hear that you have solved your problem.
      This approach is also fine. BTW, instead of the View.Closed event, you may consider subscribing to the ObjectSpace.Commited event, to ensure that the other View is updated only when data is saved.
      Another suggestion is to use the PopupWindowShowAction instead of the heavily tuned SimpleAction for displaying dialog windows. It is more often recommended, because this action type is specifically designed for such a scenario.

      G G
      Gary Zambrano Andrade 12 years ago

        Thanks you Dennis,
        I agree on the ObjectSpace.Commited event.
        Also I am going to consider the PopupWindowShowAction.
        Could you please close this case?
        Best Regards,
        Gary

        Dennis Garavsky (DevExpress) 12 years ago

          You are always welcome, Gary!
          P.S.
          Once your question has been resolved to your satisfaction, mark the corresponding answer as a Solution. Your question status will immediately become Closed.
          http://devexpress.com/Support/Center/FAQ

          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.