我想在dbgrid中点某一行的某个字段出现一个下拉框,下拉框中的内容来自其它数据集中的数据。
谢谢,在线等待。
谢谢,在线等待。
解决方案 »
- Access中导数据时,如何将文本型转化成日期时间型?
- 求救:Delphi中调用Java程序问题
- 如何使窗体不出现在下边的任务栏上?
- 小问题,大家帮帮忙忙,顶都有分!!!!!!!!!!!!!
- 两个窗体间传递消息???????????
- delphi 6 组件大全下载http://www.hrbco.com/bbs/web/dispbbs.asp?boardID=25&ID=4
- 怎么用ADOTable做一个密码登录程序???急急急!!!
- 在delph中定义字节变量怎么定义?
- 如何读某一段内存的内容并将其写入文件?
- 向高手请教ERP的问题,我会给分的!
- 请教 DBGridEH中下拉框的问题
- 我没分了,不好意思,还请教大家一个简单问题阿,情大家帮忙阿!
for j:=1 to FieldCount do
begin
if columns[j].FieldName ='peij_dw' then
begin
columns[j].PickList.Clear;
for i:=1 to recordcount do
begin
columns[j].PickList.Add(fieldbyname('danwei_lc').asstring);
next;
end;
break;
end;
end;
end;//for
这段代码放在哪个位置上呀?
PickList 这个我用过了,用sql 语句没有用呀。
procedure Tfrom1.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin with Column do
begin
if (gdfocused in state) then
begin
with DBLookupComboBox_xm do
if (FieldName=DataField) then
begin
Left:=Rect.Left+DBGridEh_shipment.left;
top:=rect.top+DBGridEh_shipment.top;
width:=rect.right-rect.left+2;
height:=rect.bottom+DBGridEh_shipment.top;
visible:=true;
setfocus;//获得焦点
end;
end;
end;
end;
procedure Tform1.DBGridEh1ColExit(Sender: TObject);
var i:integer;
begin
for i:=0 to DBGridEh1.Columns.Count-1 do
if DBGridEh_shipment.Columns[i].FieldName='xm' then
DBLookupComboBox_dh.Visible:=false;
end;