I found on your page that example how to fill unbound cxGrid Column to auto number that column. But when I sort that grid on some other column - column with auto number gets messed up values. Those values should always remain filled sorted like auto inc column in a dataset. Is there a way to modify that code to achieve that behaviour?
Delphiprocedure TForm.cxGrid1DBTableView1Column1GetDataText(
Sender: TcxCustomGridTableItem; ARecordIndex: Integer; var AText: string);
var
AFocusedRecordIndex, ARecno: Integer;
begin
ARecno := TcxGridDBTableView(Sender.GridView).DataController.DataSource.DataSet.RecNo;
AFocusedRecordIndex := TcxGridDBTableView(Sender.GridView).Controller.FocusedRecordIndex;
AText := IntToStr( ARecno - AFocusedRecordIndex + ARecordIndex);
end;