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:
- Open *some* Groups
- Select row 3
- Click Save button
- Select row 2
- Click Restore button
Actual Results:
Group collapses
Expected Results:
Group state should be restored to expanded/collapsed
as appropriate.
Selected row should be restored.
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.
> 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.
The new project you have attached has the same problem as the first one: no KeyFieldNames assigned. Set its value to BatchID or BatchNum.