hello,
On an dbadvgrid I have one combobox on col 11.
It is linked to FormControlEditLink1;
The FormControlEditLink1 is linked to AdvDBLookupComboBox3.
The AdvDBLookupComboBox3 data source is connected to an IBquery.
It is working well until now.
But now , the sql query in the IBquery needs to change dynamically.according one integer value named COFAM.
So the data in the AdvDBLookupComboBox3 changes according that value.
What is the best way to do this ?
I tried to change dynamically the sql query for AdvDBLookupComboBox3 according the value COFAM but the synchronization with the grid is not perfect.
Is there any way to do this ?
Regards
Here is a part of the code
------------------------------------------------------------------------------------------------------------
procedure TForm3.DBAdvGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer;
var AEditor: TEditorType);
begin
AEditor := edNormal;
DBAdvGrid1.EditLink := nil;
var AEditor: TEditorType);
begin
AEditor := edNormal;
DBAdvGrid1.EditLink := nil;
case Acol of
11:
begin
AEditor := edCustom;
DBAdvGrid1.EditLink := FormControlEditLink1;
end;
end;
11:
begin
AEditor := edCustom;
DBAdvGrid1.EditLink := FormControlEditLink1;
end;
end;
end;
------------------------------------------------------------------------------------------------------------
procedure TForm3.FormControlEditLink1GetEditorValue(Sender: TObject;
Grid: TAdvStringGrid; var AValue: string);
begin
AValue := AdvDBLookupComboBox3.Text;
end;
procedure TForm3.FormControlEditLink1GetEditorValue(Sender: TObject;
Grid: TAdvStringGrid; var AValue: string);
begin
AValue := AdvDBLookupComboBox3.Text;
end;
procedure TForm3.FormControlEditLink1SetEditorValue(Sender: TObject;
Grid: TAdvStringGrid; AValue: string);
begin
AdvDBLookupComboBox3.Text:=AValue;
end;
----------------------------------------------------
Grid: TAdvStringGrid; AValue: string);
begin
AdvDBLookupComboBox3.Text:=AValue;
end;
----------------------------------------------------