Ticket B222491
Visible to All Users

Sub-detail grid collapsing after AcceptChanges

created 13 years ago

Dear DevExpress Support,
I am facing a situation when having a master/detail scenario using 2 grids… Attached you can have the sample…
Basically the master grid is OK… But on the second grid(detail), when a row is expanded and I call the “Accept Changes” method on my dataset (there is a button on the form to call it), the expanded row gets collapsed… It is important to remark that on my scenario I have compound keys, but, this problem happen also with simple keys…
Can you help me to get this right?
Kind regards,
Pedro.

Show previous comments (6)
DevExpress Support Team 13 years ago

    Hi Pedro,
    I apologize, the approach you implemented simply didn't come to my mind. I have reviewed the project you sent to me and I see that you are traversing through all matching values from all columns participating in a compound key. This approach might lead to performance problems, if you have a lot of rows. Anyway, I understand your concern and I'm happy to hear that you have managed to find this solution. Thank you for informing us of that.
    Thanks,
    Ted

      Hi Ted,
      Actually the sample from DevExpress that works without compound keys does things like:
                      for (int i = 0; i < view.DataRowCount; i++)
                      {
                          if (Equals(value, view.GetRowCellValue(i, descriptor.keyFieldName)))
                              return i;
                      }
      So I did not invented that and I am fully aware of potential performance problems that I might have. But the problem is that I am not seeing another solution and the DevExpress support(which is intended to help me out) just said would be impossible. :)
      To my mind the state should be kept internally by the grid itself as this is a expected feature from the people using the grid.
      If you have any other proposition to improve performance please let me know.
      Thanks!
      Pedro

      DevExpress Support Team 13 years ago

        Hi Pedro,
        I regret to tell you there is no another way to work with compound keys. All GridControl methods are designed to be used with the usual keys and the approach you have found is only way to work with this type of keys.
        Thanks,
        Ted

        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.