Reopen Query and bring to old Order
Posted: Thu 15 Jun 2017 12:28
I want to reload a Query by doing close and open.
After this, I want to restore the last sorting.
This works fine with using IndexFieldNames like this:
The problem ist, the result is displayed in a TCRGrid. The Grid doesn't change the small triangle symbol. It still is painted at the column with is default order acording to SQL.
Do you know a way to prevent this?
After this, I want to restore the last sorting.
This works fine with using IndexFieldNames like this:
Code: Select all
procedure TForm14.ReloadButtonClick(Sender: TObject);
var
SaveIndexFields : string;
begin
SaveIndexFields := ibcquery1.IndexFieldNames;
ibcquery1.Close;
ibcquery1.Open;
ibcquery1.IndexFieldNames := SaveIndexFields;
end;
Do you know a way to prevent this?