Bug Report DB49393
Visible to All Users

restore collapses grid

created 18 years ago

We are trying to use the suggested save and restore:
http://www.devexpress.com/kbA2279,
and instead of restoring the expanded groups and the
current row, it collapses the groups.
Steps to Reproduce:

  1. Open *some* Groups
  2. Select row 3
  3. Click Save button
  4. Select row 2
  5. Click Restore button
    Actual Results:
    Group collapses
    Expected Results:
    Group state should be restored to expanded/collapsed
    as appropriate.
    Selected row should be restored.
Comments (3)
DevExpress Support Team 18 years ago

    Did you try to trace your code in RepairU unit?
    You do not have KeyFieldNames property set in the ItemDataTable1.DataController so the AView.DataController.GetRecordId method always return Null here:
    function TcxGridStatus.SaveRecord(AView: TcxGridDBTableView;
      GridRecord: TcxCustomGridRecord): TRecordInfo;
    begin
      Result := TRecordInfo.Create;
      Result.KeyValues :=
        AView.DataController.GetRecordId(GridRecord.RecordIndex);
      Result.ALevel := GridRecord.Level;
    end;
    There is no way to find a record with the Null key field value in the TcxGridStatus.FindRecordEx.
    Set DataController.KeyFieldNames to some field name with the unique values or do not use DataController.GetRecordId.

    ?
    Unknown 18 years ago

      > You do not have KeyFieldNames property set in the ItemDataTable1.DataController so the AView.DataController.GetRecordId method always return Null.
      >
      > There is no way to find a record with the Null key field value in the TcxGridStatus.FindRecordEx.
      > Set DataController.KeyFieldNames to some field name with the unique values or do not use DataController.GetRecordId.
      Interesting. This fixed it if there is only one group. The problem remains if there are more than one.
      Even more interesting. It doesn't just close the other groups. It closes all the groups, even the one that has the record we found.

      DevExpress Support Team 18 years ago

        The new project you have attached has the same problem as the first one: no KeyFieldNames assigned. Set its value to BatchID or BatchNum.

        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.