Bug Report Q391061
Visible to All Users

Problem with Focus in ListView when AutoCommit = true

created 13 years ago

Hi Guys,
i am having problems with the focus in an root ListView when AutoCommit = true. Please see the attached sample + video. The ZIP also contains a database. The problem as far as i see is that i call Save() when the child list has changed, then, when making an change in an nested listview, the focus and so the current object is lost - see video! Is there an bug, is so, how can i prevent that i loose the focus in this situation?
thx
Noxe

Show previous comments (11)
M M
Martin Praxmarer - DevExpress MVP 13 years ago

    Hi Michael,
    last reply on this topic. After 2 hours of debugging i personally think there is a small bug in the gridlisteditor in how it handles the previousfocused, i did it now with this controller. Basiscly i simply prevent the controller from subsequent calls to CommitChanges, because commitchanges is called here several times, and each time it is called during the previous commit. Easy - and works!
        public class VDListViewAutoCommitController : ListViewAutoCommitController {

    private bool _IsCommitChanges;
            protected override void CommitChanges() {
                if (this._IsCommitChanges)
                    return;
                this._IsCommitChanges = true;
                try {
                    base.CommitChanges();
                }
                finally {
                    this._IsCommitChanges = false;
                }
            }
        }

    DevExpress Support Team 13 years ago

      Hi Noxe,
      As far as I see it, the CommitChanges method is called from another CommitChanges method call only when ListViewAutoCommitController is used in an unusual scenario. This should not normally happen, and ListViewAutoCommitController is not designed for this scenario. Would you please elaborate more on "a small bug in the gridlisteditor in how it handles the previousfocused" and how to reproduce it when there is no nested CommitChanges method call?
      Thanks,
      Michael.

      M M
      Martin Praxmarer - DevExpress MVP 13 years ago

        Hi Michael,
        lets close this for now as i dont have enough free time to again do some debugging - as it works for me now, its ok for now. if i find some free time i will dig into this again!
        thx
        Noxe

        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.