如何融合TListbox到TDBGrid(100分)

T

ttl_web

Unregistered / Unconfirmed
GUEST, unregistred user!
如何融合TListbox到TDBGrid
常常需要在TDBGrid上增加或修改数据,
对特定的列,总希望最终用户用下拉列表,程序保存用列表数值的对应编码
如果哪位高手已实现类似功能,请给段代码,或一个思路,
我在此不甚感谢
 
用EnLib吧!支持此功能!
 
procedure TForm1.DBGrid1DrawDataCell
(Sender: TObject;
const Rect: TRect;
Field: TField;
State: TGridDrawState);
begin
if (gdFocused in State) then
begin
if (Field.FieldName = DBComboBox1.DataField ) then
begin
DBComboBox1.Left := Rect.Left + DBGrid1.Left;
DBComboBox1.Top := Rect.Top + DBGrid1.top;
DBComboBox1.Width := Rect.Right - Rect.Left;
DBComboBox1.Height := Rect.Bottom - Rect.Top;
DBComboBox1.Visible := True;
end;
end;
end;
这么干,自己把ListBox放进去
 
PICKlist就行吧。
 
同楼上的,设置字段的picklist属性即可
 
接受答案了.
 

Similar threads

回复
0
查看
665
不得闲
回复
0
查看
853
不得闲
回复
0
查看
677
不得闲
顶部