新手求教!cxgird中把某一列属性设为combobox,怎么赋值?

Bone_storm 2017-12-15 12:03:13
我将CXGrid 字段列 Properties 属性设置为 Combobox后,不知道怎么给combobox中添加item
...全文
358 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Bone_storm 2017-12-18
  • 打赏
  • 举报
回复
引用 3 楼 lyhoo163 的回复:
qry_type是数据集控件。
才学习一周,现在还看不懂这个代码,过段时间再看
lyhoo163 2017-12-17
  • 打赏
  • 举报
回复
qry_type是数据集控件。
Bone_storm 2017-12-16
  • 打赏
  • 举报
回复
(cxGrid1DBTableViewtype.Properties as TcxComboBoxProperties) 我只写了cxGrid1DBTableViewtype.Properties,怎么也找不到Items qry_type这个是数据库吗?
lyhoo163 2017-12-15
  • 打赏
  • 举报
回复
procedure TnPOP_DCzuzhuang.FormActivate(Sender: TObject);
begin
(cxGrid1DBTableViewtype.Properties as TcxComboBoxProperties).Items.Clear;
     qry_type.Close;
     qry_type.SQL.Text:='select distinct itemname from t_mi_item';
     qry_type.Open;
     while not qry_type.Eof do
      begin
        if length(trim(qry_type.fieldbyname('itemname').AsString))<>0 then
          (cxGrid1DBTableViewtype.Properties as TcxComboBoxProperties).Items.Add(qry_type.fieldbyname('itemname').AsString);
        qry_type.Next;
      end;
  end;

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧