在表格里用combobox很正常
自带的dbgrid加也很方便,环境是xe10
procedure TfrmBaseInfo.LoadDesk;
var
ssql: string;
i: Integer;
column: TColumn;
begin
ssql := 'select * from desk_info ';
qry_desk.Connection := dmMain.FDConnection1;
qry_desk.Close;
qry_desk.SQL.Clear;
qry_desk.SQL.Text := ssql;
qry_desk.Open();
column := DBGrid3.Columns.Items[2];
for I := 1 to qry_desk.RecordCount do
begin
qry_desk.RecNo := i;
column.PickList.Add(qry_desk.FieldByName('desk_name').asstring);
end;
end;