Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-07

DBLookupComboBox anomaly

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi,

On Windows a DBLookupComboBox not show any value before explicitly set KeyValue to not null value or select is correct.
On Kubuntu 14.04 64bit+Qt, if open the DataSet(query) or add a record to an empty DataSet in FormShow the first record showed in DBLookupComboBox, see the example below. But if do open/append in FormCreate works like with Windows, no value selected automatically. Why a value selected automatically if call open/append in FormShow? I use fixes_1_4(49527) with fixes_3_0(31206).

procedure TForm1.FormCreate(Sender: TObject);
begin
   BDS:=TBufDataset.Create(Self);
   BDS.FieldDefs.Add('ID',ftInteger);
   BDS.FieldDefs.Add('NAME',ftString,10);
   dsBDS:=TDataSource.Create(Self);
   dsBDS.DataSet:=BDS;
   DBLookupComboBox1.Style:=csDropDownList;
   DBLookupComboBox1.ListSource:=dsBDS;
   DBLookupComboBox1.ListField:='NAME';
   DBLookupComboBox1.KeyField:='ID';
   BDS.CreateDataset;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
   BDS.AppendRecord([1,'aaa']);
end;

Gabor

Reply by email